[EDIT] : Sorry guys, the whole post didn't go through. Here is the correct post.
Hi,
I have a multilevel menu like this :
<ul>
<li>item 1
<ul>
<li>item 1.1</li>
<li>item 1.2</li>
</ul>
</li>
<li>item 2</li>
<li>item 3
<ul>
<li>item 3.1</li>
<li>item 3.2</li>
</ul>
</li>
<li>item 4</li>
</ul>
In jQuery I have
$("#divId ul li:odd").addClass("blue");
$("#divId ul li:even").addClass("green");
The problem is that jQuery adds the class to all the lists. I would like jQuery to just add the class to the first level (ul > li.class) and NOT the inner childs (ul > li > ul > li.class)
Thanks