In JavaScript, the Event() constructor creates a new Event object (MDN). Events made this way are called synthetic (script-made), as opposed to browser-fired events. Fire them with dispatchEvent().
Pass the required arguments shown below. Synthetic events are not trusted until you understand isTrusted and dispatch rules.
Syntax
Create an Event. Start with this line.
JavaScript
new Event(type) / new Event(type, options)
Call
What it does
new Event(type) / new Event(type, options)
Primary signature.
Built into the browser. Call new Event(...) — no import required.
Library declarations
JavaScript
new Event(type) / new Event(type, options)
Parameters
Parameter
Description
type
Required. Event name string
options
Optional. bubbles, cancelable, composed
Return Value
Return Value
Description
*
A new Event instance
JavaScript Examples
Example 1 — Basic new Event(type)
Create an event with only a type and inspect the default flags.
Prepare a target. Any EventTarget (or DOM node) can listen and dispatch.
Register first.addEventListener("look", …) must run before dispatch.
Create then fire.dispatchEvent(evt) runs the handler → heard becomes true.
Synthetic flag.isTrusted stays false because the event came from your script.
Compatibility
Browser Support
The Event() constructor is marked Baseline Widely available on MDN (since July 2015). It is a browser Web API (also available in Web Workers) - not a Node.js language built-in like Array methods.
✓ Baseline · Widely available
Event()
Create synthetic events in modern browsers. No polyfill needed for current evergreen browsers.
99%Core tag support
ChromeYes
Full support
EdgeYes
Full support
FirefoxYes
Full support
SafariYes
Full support
OperaYes
Full support
HTML element100% supported
Bottom line: Safe for production web apps. Prefer new Event() over deprecated initEvent(). Use CustomEvent when you need a detail payload.
Frequently Asked Questions
new Event(type, options) creates an Event object. Events built this way are synthetic (script-made). You can inspect them or fire them with target.dispatchEvent(event).
No. MDN marks Event() as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard. It is also available in Web Workers.
An optional options object may include bubbles (default false), cancelable (default false), and composed (default false). composed controls whether the event can cross shadow DOM boundaries.
Create it with new Event("look", { bubbles: true }), then call element.dispatchEvent(event) or document.dispatchEvent(event). Matching listeners run.
Browser-generated events have isTrusted === true. Events from new Event() have isTrusted === false, so handlers can tell real user input from script-made events.
Use CustomEvent when you need a detail payload. Use MouseEvent (or other UIEvent subclasses) for mouse fields. Use Event for a simple named signal with no extra data.