Event.createEvent() - API web | MDN

Crea un nuevo evento, que debe ser inicializado llamando a su método init().

Sintaxis

js

document.createEvent(tipo);
tipo

Una string indicando el tipo de evento a crear.

Este método devuelve un nuevo objeto Event del DOM del tipo indicado, que debe ser inicializado antes de su uso.

Ejemplo

js

var nuevoEvento = document.createEvent("UIEvents");

Especificaciones

Specification
DOM
# dom-document-createevent

Compatibilidad del Navegador

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.