dom-listeners

DOM listeners made easy

dom-listeners

DOM Event listeners made easy.

npm install dom-listeners
// Simple listener 
var on = require('dom-listeners/listener'),
    byId = require('dom-essentials/by').id;
 
var someEl = byId('some-id');
 
on(someEl, 'click', function(e) {
    // Event listening! 
});
 
// Delegation 
var delegate = require('dom-listeners/delegation');
 
delegate(document, 'click', 'li', function(e) {
    console.log(this.nodeName); // "LI" 
});

MIT License.