|
hace 2 años | |
---|---|---|
.. | ||
test | hace 2 años | |
.npmignore | hace 2 años | |
History.md | hace 2 años | |
Makefile | hace 2 años | |
Readme.md | hace 2 años | |
component.json | hace 2 años | |
index.js | hace 2 años | |
package.json | hace 2 años |
Element event binding component.
$ component install component/event
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);
Bind to el
's event type
with callback
,
returns the callback
passed.
Unbind el
's event type
callback
,
returns the callback
passed.
MIT