I have several similar links that trigger different navigation divs to appear. I am trying to find a way in JQuery to determine which of the links was clicked and then trig
you can use rel
html:
Click me
Click me
Click me
Foo
Foo
Foo
javascript:
$('.expander').click(function(e) {
$('#' + $(this).attr('rel')).toggle();
e.preventDefault();
return false;
});
You can use .index() if you want to know the relative position of the ancho being clicked, you need to wrap the anchors though:
jsfiddle