how to add multiple eventlister code example
Example 1: window.addeventlistener multiple events
"mousemove touchmove".split(" ").forEach(function(e){
window.addEventListener(e,mouseMoveHandler,false);
});
Example 2: how to add eventlister to multiple variable
document.querySelectorAll('.some-class').forEach(item => {
item.addEventListener('click', event => {
//handle click
})
})