> Assume, if the li element and anchor element have unique IDs. Is there a
> way list by using their IDs. Or is there way to list the childs of the
> particular element.
I'm not exactly sure what you're asking but, yes, you could find all
children of the clicked menu item:
$("#myTree a").click(function() {
var immediateChildren = $(this).next().children("li");
var allDescendants = $(this).next().find("li");
});
Those will find the li elements but you can modify it to get the a
elements or the href values or the a text or whatever.
Hope that helps - like I said, I'm not sure what you're after, exactly.
Nathan
No comments:
Post a Comment