Apply new format to snippets and template

This commit is contained in:
Angelos Chalaris
2020-09-15 16:28:04 +03:00
parent 040efd4380
commit 53c16dbf65
401 changed files with 969 additions and 950 deletions

View File

@ -5,8 +5,8 @@ tags: browser,event,intermediate
Removes an event listener from an element.
Use `EventTarget.removeEventListener()` to remove an event listener from an element.
Omit the fourth argument `opts` to use `false` or specify it based on the options used when the event listener was added.
- Use `EventTarget.removeEventListener()` to remove an event listener from an element.
- Omit the fourth argument `opts` to use `false` or specify it based on the options used when the event listener was added.
```js
const off = (el, evt, fn, opts = false) => el.removeEventListener(evt, fn, opts);
@ -16,4 +16,4 @@ const off = (el, evt, fn, opts = false) => el.removeEventListener(evt, fn, opts)
const fn = () => console.log('!');
document.body.addEventListener('click', fn);
off(document.body, 'click', fn); // no longer logs '!' upon clicking on the page
```
```