Web APIs
Event.cancelable
Indicates whether cancellation can prevent the event default action. It does not indicate whether cancellation has already occurred.
Formal Syntax & Structure
javascript syntaxjavascript
event.cancelableReturn Value
boolean
True when cancellation is supported.
Working Example
Example Snippetjavascript
const e=new Event("save",{cancelable:true}); console.log(e.cancelable,e.defaultPrevented); e.preventDefault(); console.log(e.defaultPrevented);