I have a tree structure, that tree has an unwanted list (ul). I have lei objects in it, and In that Lee item it can be a duration or a UL list.
This is a part of my code:
& lt; Li id = "main_li" & gt; & Lt; Div class = "first_design" & gt; & Lt; / Div & gt; & Lt; Period & gt; Products & lt; / Span & gt; & Lt; Ul style = "display: block;" & Gt; & Lt; Li & gt; & Lt; Div class = "partition 1" & gt; & Lt; / Div & gt; & Lt; Period & gt; Product_cat_1 & lt; / Span & gt; & Lt; Ul style = "display: none;" & Gt; & Lt; Li & gt; & Lt; Period & gt; & Lt; products_cat_1_milk / Span & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; Period & gt; Products_yoghurt's & lt; / Span & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; Period & gt; Products_butter & lt; / Span & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt;
I want to reach the elements in the UL tag where the original li id is "main_li", I want to get it by clicking on SPAN.
How can I do this with jquery?
The CSS selector, which corresponds to the elements under uls, whose parents are 'main_li' / P>
#main_li> UL & gt; Li
and to comment below:
To reach ul, there is a brother for the period, you want the selector if you have a click handler on the span , Then this period will be it
:
var siblingUL = $ (this) .next ('ul');
Comments
Post a Comment