I have a tree generated from database in apex 4.2:
<ul id="ltr">
<li id="00010" class="open"><a href="" style="" class=""><ins> </ins>Root</a>
<ul><li id="00110" class="open"><a href="" style="" class=""><ins> </ins>CHILD</a>
<ul><li id="00563" class="open"><a href="" style="" class=""><ins> </ins>CHILD</a>
<ul><li id="02057" class="leaf"><a href="" style="" class=""><ins> </ins>LAST CHILD</a></li>
</ul></li></ul>
</li>
</ul>
</li>
</ul>
I use a click function to select the id of a node, with class leaf no problem, but with open class selects the parent and the parent id, How Can I select the id of the node clicked ?
$(".leaf").click(function(){
alert($(this).attr('id'));
});
$(".open").click(function(){
alert($(this).attr('id'));
});