I have a many elements with “click” events.
How to add a some condition in jquery click event for all buttons ? Override standart click event ?
for example:
if ( my_condition ) {
return click();
} else {
return false;
}
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.
If you want to target all buttons
If the condition is false, then this shouldn’t interrupt the default behavior.