If you plan on creating at least 3 or more event handlers in Javascript, the function below can save you some time and typing.
The Javascript function below allows you to create an unlimited number of event handlers with one function call in Javascript.
For this Javascript multiple event handler function to work, you need to create 3 separate arrays ...
Here is the actual function to create multiple event handlers:
Here is an example of how to use this multiple event handler function:
You can try this out for yourself with these three buttons. Right click this web page and VIEW SOURCE to see how it works.
For this example, all 4 event handlers created pointed to the same function but they can point to different functions.