Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    dom-listenerspublic

    dom-listeners

    DOM Event listeners made easy.

    Installation

    npm install dom-listeners
    

    API

    // 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" 
    });

    Contributors

    License

    MIT License.

    Keywords

    none

    install

    npm i dom-listeners

    Downloadsweekly downloads

    1

    version

    0.1.0

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar