O Event()
cria uma nova Event
.
Sintaxe
event = new Event(typeArg, eventInit);
Valores
- typeArg
- É uma
DOMString
representa o nome do evento. - eventInitOptional
Exemplo
// criar um evento com bubbles true e que não pode ser cancelado
var ev = new Event("look", {"bubbles":true, "cancelable":false});
document.dispatchEvent(ev);
Especificações
Especificação | Status | Comentário |
---|---|---|
DOM The definition of 'Event()' in that specification. |
Padrão em tempo real | Definição inicial. |
Compatibilidade de browser
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.