Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add multiple event listeners

['click','ontouchstart'].forEach( function(evt) {
    element.addEventListener(evt, dosomething, false);
});
 
PREVIOUS NEXT
Tagged: #add #multiple #event #listeners
ADD COMMENT
Topic
Name
4+9 =