Nossos voluntários ainda não traduziram este artigo para o Português (do Brasil). Junte-se a nós e ajude-nos a fazer o trabalho!
Você também pode ler o artigo em English (US).

Deprecated
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Creates a new event, which must then be initialized by calling its initEvent() method.

Do not use this method anymore as it is deprecated.

Instead use specific event constructors, like Event(). The page on Creating and triggering events gives more information about the way to use these.

Syntax

document.createEvent(type) 
type
A string indicating the event type to create.

This method returns a new DOM Event object of the specified type, which must be initialized before use.

Example

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

Specification

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome No support NoEdge ? Firefox ? IE ? Opera No support NoSafari ? WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android ? Opera Android No support NoSafari iOS ? Samsung Internet Android ?

Legend

No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Etiquetas do documento e colaboradores

Colaboradores desta página: urty5656, fscholz, vrana, teoli, kscarfone, Cobra, Sheppy, Matej Lednar
Última atualização por: urty5656,