cancelable Event Property - Javascript DOM

Javascript examples for DOM:Event


The cancelable event property indicates if an event is a cancelable event.

Return Value

A Boolean, indicating if the event is a cancelable event.

The following code shows how to find out if a specific event isCancelable

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction(event)">Test</button>

<p id="demo"></p>

function myFunction(event) {/*w ww .j av  a  2 s .  c  o  m*/
    var x = event.cancelable;
    document.getElementById("demo").innerHTML = x;


Related Tutorials