Call init again. It should not reconfigure the event.
Create a new event if you need different flags.
Compatibility
Browser Support
Event.initEvent() is marked Deprecated on MDN. Engines still implement it for createEvent compatibility. New code should use constructors. Also available in Web Workers (still deprecated).
✓ Deprecated
Event.initEvent()
Legacy initializer for createEvent — migrate to new Event().
LegacyDeprecated
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
initEvent()Prefer new Event()
Bottom line: Supported for compatibility, not for new APIs. Prefer new Event(). See the MDN initEvent reference.
Frequently Asked Questions
It initializes an event created with document.createEvent() by setting type, bubbles, and cancelable before you call dispatchEvent(). Once the event has been dispatched, calling initEvent() again does nothing useful.
MDN marks Event.initEvent() as Deprecated. Prefer event constructors such as new Event("click", { bubbles: true, cancelable: false }). It is not labeled Experimental or Non-standard on that MDN page. Also available in Web Workers.
Use new Event(type, options), or a more specific constructor (CustomEvent, MouseEvent, KeyboardEvent, and so on). Then dispatch with target.dispatchEvent(event).
Modern code should not need initEvent() at all. The constructor options already set type, bubbles, and cancelable. initEvent() was paired with the older document.createEvent() API.
type (string event name), bubbles (boolean), and cancelable (boolean). After init, you can read event.type, event.bubbles, and event.cancelable.
Yes. MDN notes the feature is available in Web Workers, but it remains deprecated—prefer constructors there too when available.