Custom events in JavaScript - Basic JavaScript Fast (63) | dispatchEvent, isTrusted

preview_player
Показать описание
This video introduces custom events in JavaScript. JavaScript can generate its own events, or ordinary events like mouse events and keyboard events.

We can create a new event object using the built-in Event class. The type can be ordinary event type or user-defined type. After making a custom event object, we can dispatch the event to an event target element. If the event object is generated by JavaScript itself, the isTrusted property would have a value of "true".

There are also some standard user interface event classes that can be used directly. These event classes provide special properties for us to use. Examples are MouseEvent, FocusEvent, KeyboardEvent and so on.

There is also a CustomEvent class that contains a "detail" field to store custom key-value pairs of a custom event object.

2:07 - Event class
9:16 - Standard user interface (UI) events
12:05 - CustomEvent class

Playlist of my JavaScript course

Playlist of my HTML5 and CSS3 tutorials

Playlist of my algorithm walkthrough

Playlist of my Java course

Playlist of my Java examples

#javascripttutorial #javascriptfullcourse #begincodingfast #javascript #customevent
Рекомендации по теме
Комментарии
Автор

hey i lile your vid do you know any work arround istrusted: true using java script? not extensions

thefinancer