My HTML is like so:
<img src="/path" id="img_1">
<img src="/path" id="img_2">
<img src="/path" id="img_3">
<img src="/path" id="img_4">
I want to alert out the id of the button that was clicked.
How can I accomplish that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
DEMO
Or a more ‘dynamic version’ (if you are adding the images by ajax or some other implementation):