Introduced 3.1.0
3.1.0
Add event listeners to node lists instead of singular nodes. (applies addEventListener to a NodeList)
addEventListener
NodeList
function handler() {}; listeners.add(document.querySelectorAll('button'), 'click', handler);
With options set:
options
function handler() {}; listeners.add(document.querySelectorAll('button'), 'click', handler, { passive: true, once: true });
Note Remember, if you want to remove event listeners, you need to specify the same function reference and same options when removing as when adding.
There was an error while loading. Please reload this page.