JS Built-ins
Eventbeginner

Event β€” type property

πŸ“– Usage Example
const e = new Event('click', { bubbles: true })
e.type      // β†’ 'click'
e.bubbles   // β†’ true

type and bubbles are core Event properties describing the event kind and propagation.

Event.type

The type property on an event reflects the event type string passed to the constructor.

Challenge: Verify that new Event('submit').type is 'submit'.

πŸ’‘ Hints (1)
  • β€’ The type is always a lowercase string matching what you passed to the constructor