[jQuery] Traversing Question with Parent and Children

2008-10-25 Thread Jason
I have HTML similar to the following: red border Essentially I have a div with a link inside of it. What I want to do is have the div selected when the link is clicked. I need this done without referencing the class/id of the parent div. So far I have: $(".link").click(function () {

[jQuery] traversing question

2007-12-14 Thread pixeline
hello! i have this (sample) html: item1 item2 item3 item1 item2 item3 when one clicks on an anchor, i need to get the index of that anchor 's LI inside it UL. i managed to do it like this, and i would like to know if there is an easier/smarter way to do it. Knowing jquery, there must be!