GlobalEventHandlers.oncancel

Você está lendo a versão em inglês deste conteúdo porque ainda não há uma tradução para este idioma. Ajude-nos a traduzir este artigo!

The oncancel property of the GlobalEventHandlers mixin is an EventHandler for processing cancel events sent to a <dialog> element.

The cancel event fires when the user indicates a wish to dismiss a <dialog>. This event handler prevents the event from bubbling, so any parent handlers are not notified of the event.

Syntax

target.oncancel = functionRef;

Value

functionRef is a function name or a function expression. The function receives an Event object as its sole argument.

Only one oncancel handler can be assigned to an object at a time. You may prefer to use the EventTarget.addEventListener() method instead, since it's more flexible.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'oncancel' in that specification.
Living Standard  

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
oncancelChrome Full support YesEdge ? Firefox No support NoIE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also