I have 6 buttons that I want to be attached to the same handler. How can I do this?
Share
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.
When you subscribe to the event on a button, it’s just a standard event handler:
You can use the same code to add handlers for every button:
This will cause your handler in
myEventHandlerto be run when any of the buttons are clicked.