I have numerous buttons on my page with the same class names. However these buttons have different ID’s. How do i do this:
$(".vote").click(function(){
var id = $(this).{ID OF CLICKED BUTTON};
});
How can i make this pseudo code work?
Thanks
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.
The ID is accessible directly from the element. There’s absolutely no need to use a jQuery method.