Latest web development tutorials
 

cancelable Event Property

< Event Object

Example

Find out if a specific event is cancelable:

var x = event.cancelable;

The result of x could be:

true
Try it Yourself »

Definition and Usage

The cancelable event property returns a Boolean value indicating whether or not an event is a cancelable event.

The event is cancelable if it is possible to prevent the events default action.

To cancel an event, use the preventDefault() method.


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
cancelable Yes 9.0 Yes Yes Yes

Syntax

event.cancelable

Technical Details

Return Value: A Boolean, indicating whether the specified event is a cancelable event.

Possible values:

  • true - The event is cancelable
  • false - The event is not cancelable
DOM Version: DOM Level 2 Events

< Event Object