Summary
Indicates whether the event is cancelable or not.
Syntax
bool = event.cancelable
- The result is a
Boolean, which istrueif the event can be canceled.
Example
var bool = event.cancelable;
bool contains true or false, depending on whether the event can have its default action prevented.
Notes
Whether an event can be canceled or not is something that's determined when that event is initialized.
To cancel an event, call the preventDefault() method on the event. This keeps the implementation from executing the default action that is associated with the event.
Specifications
| Specification | Status | Comment |
|---|---|---|
| DOM The definition of 'Event.cancelable' in that specification. |
Living Standard | |
| Document Object Model (DOM) Level 2 Events Specification The definition of 'Event.cancelable' in that specification. |
Recommendation | Initial definition. |
Document Tags and Contributors
Tags:
Contributors to this page:
DomenicDenicola,
cvrebert,
fscholz,
teoli,
MHasan,
kscarfone,
Cobra,
ethertank,
Sheppy,
DavidWalsh,
ziyunfei,
Matej Lednar,
Kohei,
Mgjbot,
Jabez,
Nickolay,
Ptak82,
Dria,
JesseW
Last updated by:
DomenicDenicola,