Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Event binding component

branch: master
Octocat-spinner-32 test Update file to test in IE7+ November 11, 2013
Octocat-spinner-32 .gitignore Initial commit October 06, 2012
Octocat-spinner-32 History.md Release 0.1.3 February 10, 2014
Octocat-spinner-32 Makefile Initial commit October 06, 2012
Octocat-spinner-32 Readme.md Release 0.1.0 December 18, 2012
Octocat-spinner-32 component.json Release 0.1.3 February 10, 2014
Octocat-spinner-32 index.js wtf December 29, 2013
Octocat-spinner-32 package.json Release 0.1.3 February 10, 2014
Readme.md

event

Element event binding component.

Installation

$ component install component/event

Example

var events = require('event');
var a = document.querySelector('a');

function onclick(e) {
  e.preventDefault();
  console.log(e.target);
  events.unbind(a, 'click', onclick);
}

events.bind(a, 'click', onclick);

API

.bind(el, type, callback, [capture])

Bind to el's event type with callback, returns the callback passed.

.unbind(el, type, callback, [capture])

Unbind el's event type callback, returns the callback passed.

License

MIT

Something went wrong with that request. Please try again.