Open In App
Related Articles

HTML | DOM cancelable Event Property

Improve Article
Save Article
Like Article

The cancelable Event property is used to indicate whether or not an event can have its default actions prevented. If the default actions can be prevented the value is true, else the value is false. It is a read-only property.


Return Value: It returns a Boolean which indicates whether the event is cancelable or not.

  • It returns true indicating the event is cancelable.
  • It returns false indicating the event is not cancelable.


<!DOCTYPE html>
    <title>DOM cancelable Event Property</title>
<body style="text-align:center">
    <h1 style="color: green;">
        DOM cancelable Event Property
    <button onclick="Geeks(event)">Click Here!</button>
    <p id="p"></p>
        function Geeks(event) { 
            var x = event.cancelable;
            document.getElementById("p").innerHTML = 
                                    "Cancelable: " + x;

Before clicking on the button:
After clicking on the button:
Supported Browsers: The browser supported by cancelable Event property are listed below:

  • Apple Safari
  • Google Chrome
  • Firefox
  • Opera
  • Internet Explorer
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 18 Jan, 2019
Like Article
Save Article
Similar Reads
Complete Tutorials