JQuery: which element was clicked?

Posted by centr0 on Stack Overflow See other posts from Stack Overflow or by centr0
Published on 2010-03-23T22:27:44Z Indexed on 2010/03/23 22:33 UTC
Read the original article Hit count: 274

Filed under:
|

I have a list with links. These links are links to tables on the same page. What I want to do is whatever link I click in the list it will show its corresponding table and hide all the others.

Without adding a different id/class to each link in the list and its corresponding table, is there a way to find out which element was clicked and show() its table?

From what I understand JQuery returns an array object on its selector. How can I find out what element of the array was clicked?

I've tried to use event.which but I'm a little lost.

Help is greatly appreciated!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about event