dom-on

Alias a DOM node's .addEventListener() to .on()

Usage no npm install needed!

<script type="module">
  import domOn from 'https://cdn.skypack.dev/dom-on';
</script>

README

dom-on

NPM version build status Test coverage Downloads js-standard-style

Alias a DOM node's .addEventListener() to .on().

Installation

$ npm install dom-on

Usage

const on = require('dom-on')

const button = document.createElement('button')
on(button)

button.on('click', () => console.log('oOOoooOOoooO!'))

See Also

  • dom-wrap - Make dom elements easier to work with

License

MIT