jquery - Add Classes to first level list tags -
Is there a way to add squares to only one level on the li tag? At this time M case looks like this:
& lt; Ul & gt; & Lt; Li & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; / Li & gt; & Lt; / Ul & gt; And this is what gives me & lt; Ul & gt; & Lt; Li class = "levy-a" & gt; & Lt; / Li & gt; & Lt; Li class = "levy-a" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li class = "levy-a" & gt; & Lt; / Li & gt; & Lt; / Ul & gt;
Thank you for your help in advance.
Dom
try this:
$ ("*: No (li)" gt; ul & gt; li). AddClass ("levi one")
Comments
Post a Comment