on:*
Edit this pageFor events with capital letters, listener options, or if you need to attach event handlers directly to a DOM element instead of optimized delegating via the document, use on:*
in place of on*
.
This directly attaches an event handler (via addEventListener
) to the div
.
Info:
New in v1.9.0
An aditional special syntax that allows full control of capture
, passive
, once
and signal
is an intersection or combination of EventListenerObject
& AddEventListenerOptions
, as follows:
This new syntax replaces the now deprecated oncapture:
and it's future proof for any posible new event listener options.