MDN self-hosted library · e01.org

UIEvent: initUIEvent() method

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const e = document.createEvent("UIEvent");
// creates a click event that bubbles, can be canceled,
// and with its view and detail property initialized to window and 1,
// respectively
e.initUIEvent("click", true, true, window, 1);