I was wondering if it possible to figure out using javascript, which button was pressed.
Let me explain.
Imagine a load of links on the page like so:
etc etc..HTML Code:<a href="" onClick="check()" id="dog"><img src="image.png"></a> <a href="" onClick="check()" id="cat"><img src="image1.png"></a> <a href="" onClick="check()" id="horse"><img src="image2.png"></a>
so in the onClick function, check, i would want to be able to get the id of the a tag that was clicked.
The reason i ask is because i want to be able to build it into an ajax function. but i need to know which 1 was clicked.
Is there anyway of finding out?




Reply With Quote


Bookmarks