Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gfellerph/live-event
Live event binding in the DOM using plain JavaScript.
https://github.com/gfellerph/live-event
Last synced: about 1 month ago
JSON representation
Live event binding in the DOM using plain JavaScript.
- Host: GitHub
- URL: https://github.com/gfellerph/live-event
- Owner: gfellerph
- Created: 2015-12-15T15:47:40.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-15T16:46:39.000Z (about 9 years ago)
- Last Synced: 2024-10-15T02:06:47.858Z (3 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# live-event
Live event binding in the DOM using plain JavaScript. This repo is based on this article http://stackoverflow.com/questions/9106329/implementing-jquerys-live-binder-with-native-javascript and all credit goes to OP.## Install:
```
npm install live-event
```## Usage
With [browserify](http://browserify.org/) or [webpack](https://webpack.github.io/):
```
var live = require('live-event');live('click', '.target', function (event) {
console.log(event);
});
```## API
`live(eventType, querySelector, callback) -> undefined`
### eventType
RequiredTpye: `String`
A DOM event.
### querySelector
RequiredType: `String`
A `querySelector` String.
### callback
RequiredType: `Function`
Event handler function.
## Supported browsers
http://caniuse.com/#search=querySelector