Jump to content
Sign in to follow this  

button help

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

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...