Update snippet descriptions

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-22 20:24:44 +03:00
parent 5cb69e3c5c
commit aa425812b4
40 changed files with 151 additions and 87 deletions

View File

@ -6,7 +6,7 @@ tags: browser,event,intermediate
Triggers a specific event on a given element, optionally passing custom data.
- Use `new CustomEvent()` to create an event from the specified `eventType` and details.
- Use `el.dispatchEvent()` to trigger the newly created event on the given element.
- Use `EventTarget.dispatchEvent()` to trigger the newly created event on the given element.
- Omit the third argument, `detail`, if you do not want to pass custom data to the triggered event.
```js