cancelable Event Property - Javascript DOM

Javascript examples for DOM:Event

Description

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>
<html>
<body>

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

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

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

</body>
</html>

Related Tutorials