I have multiple class events bind together for a click event ,
i want to know which class is clicked , how can i get current user selected class
$('.class2 , .class3 , .class3').bind('click', function () {
location.href = "test.htm";
});
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.
You can use
.classNamelike this:It can be anywhere from 1 to 3 of those classes though, including other unrelated classes.
Or, since you only actually have 2 if you want to test it using
.hasClass()that’s an option as well: