News
javascript: Choose an Event Listener Mechanism
Sometimes you need to use `addEventListener` to listener to particular events as there are no corresponding HTML attribute or object property event handlers for the event. … more Read More
Sometimes you need to use `addEventListener` to listener to particular events as there are no corresponding HTML attribute or object property event handlers for the event. … more Read More
This lesson explores some of the strangeness of the target phase, including the execution of capture and bubble phase event listeners added to the event target. … more Read More
Two separate `event` object methods exist for stopping an event: `event.stopPropagation()` and `event.stopImmediatePropagation()`. This lesson will explain the differences between these two functions as well as cautioning you about some dangers in stopping … more Read More
In addition to the browser creating events, it is also possible for you to create and dispatch your own events. … more Read More
Event delegation is a simple, but powerful leveraging of the DOM event system which allows for easier adding of functionality to dynamically created content; as well as being an interesting performance optimization. … more Read More
The `error` and `beforeunload` events have their own bespoke approaches to canceling the event because nothing is easy. … more Read More
There are some deprecated mechanisms for creating events that should be avoided. … more Read More
Does the dispatching of an event queue a future task, or is the event dispatched straight away? And when are event listeners executed? Eventually or straight away? This lesson will show you how dispatching an event occurs synchronously and all event listeners … more Read More
It is common to log `event` objects to the `console`. However, it is important to keep in mind that object properties are evaluated in objects logged to the `console` when the object is first expanded. … more Read More
Using HTML attributes event handlers and object property event handlers are related ways of expressing a single event listener binding to an element. This lesson explores the dynamics and often strangeness of that relationship. … more Read More