I have this:
<div ><a href='#' id='my_target'>Link</a></div>
<div></div>
<div><div></div></div>
<div><div id='my_div'></div></div>
How can I select #my_target, when the event is triggered from my_div?
I tried things such as prev().prev().prev().children(), but I can’t get it to work, and I want something more efficient.
Alternatively, you can also just use relative paths:
HTML:
JS:
JSFiddle:
http://jsfiddle.net/5Bf6g/