Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Implements event delegation.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
README.md
package.json

README.md

delegation

Purpose

Implements event delegation.

Example

var delegate = require('delegation');

delegate(document, 'click', 'li', function(e) {
    console.log(this.nodeName); // "LI"
});

API

The module returns a function with four arguments:

  • parent: the parent on which to listen for the event
  • event: the event to listen to
  • selector: the selector for the elements to delegate to
  • handler: the event handler

Installation

npm install delegation

Contributors

License

MIT License.

Something went wrong with that request. Please try again.