Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript add event listenner for multiple events

function addListenerMulti(el, s, fn) {
  s.split(' ').forEach(e => el.addEventListener(e, fn, false));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #add #event #listenner #multiple #events
ADD COMMENT
Topic
Name
4+5 =