find the children in jquery
Posted
by armin etemadi
on Stack Overflow
See other posts from Stack Overflow
or by armin etemadi
Published on 2010-05-16T06:06:24Z
Indexed on
2010/05/16
6:10 UTC
Read the original article
Hit count: 294
i have a tree structure,there is an unordered list(ul) in that tree.i have li items in it,and in that li items it could be a span or an ul list.
this is one part of my codes :
<li id="main_li">
<div class="first_division"></div>
<span>products</span>
<ul style="display: block;">
<li>
<div class="division1"></div>
<span>products_cat_1</span>
<ul style="display: none;">
<li>
<span>products_cat_1_milk</span>
</li>
</ul>
</li>
<li>
<span>products_yoghurt</span>
</li>
<li>
<span>products_butter</span>
</li>
</ul>
</li>
i want to access li elements in ul tag where the parent li id is "main_li",i want to get it done by clicking on the span within li.
how can i do this with jquery?
© Stack Overflow or respective owner