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

Описание к видео Custom events in JavaScript - Basic JavaScript Fast (63) | dispatchEvent, isTrusted

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
   • [20 hours] JavaScript tutorial for be...  

Playlist of my HTML5 and CSS3 tutorials
   • [12 hours] HTML and CSS tutorials for...  

Playlist of my algorithm walkthrough
   • Algorithms and data structures | DSA ...  

Playlist of my Java course
   • [14 hours] Java tutorial for beginner...  

Playlist of my Java examples
   • Java projects for beginners | Java pr...  

#javascripttutorial #javascriptfullcourse #begincodingfast #javascript #customevent

Комментарии

Информация по комментариям в разработке