JS Built-ins
Eventbeginner

Event β€” cancelable property

πŸ“– Usage Example
const e = new Event('x')
e.isTrusted  // β†’ false (created by script, not user)

isTrusted is true for events dispatched by the browser, false for programmatic events.

Event.cancelable

The cancelable property is true when the event was constructed with { cancelable: true }.

Challenge: Verify that new Event('x', { bubbles: true, cancelable: true }).cancelable is true.

πŸ’‘ Hints (1)
  • β€’ cancelable must be explicitly set to true β€” it does not default to true