Update on.md

This commit is contained in:
atomiks
2018-01-06 03:01:08 +11:00
committed by GitHub
parent 517aaa78c1
commit 81bfc98792

View File

@ -7,7 +7,8 @@ Use `EventTarget.addEventListener()` to add an event listener to an element. If
target specified and then invoke the callback by supplying the correct `this` context.
Use `options` to pass options to `addEventListener` or omit it to use bubbling by default.
In order to use this function with `off`, the reference to the custom delegator function
is returned if the `target` option is specified.
is returned if the `target` option is specified. Omit `opts` to default to non-delegation
behavior and event bubbling.
```js
const on = (el, evt, fn, opts = {}) => {