Jump to content

button help


kpiatak
 Share

Recommended Posts

The function addEventListener can be used to add multiple event handlers. However, it isn't fully cross-browser (IE, as usual, doesn't follow the rules). So, the easier way is to just call your two functions within a wrapper function and asign the wrapper as the handler:

function wrapperFunc() {  busSliderFunction();  phoneMsgFunction();}element.onclick= wrapperFunc;

Or if you want to use an anonymous function, you won't have to define wrapperFunc:

element.onclick= function() {  busSliderFunction();  phoneMsgFunction();}

Edited by ShadowMage
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...