cancelable event attribute
cancelable Event properties
Definition and usage
The cancelable event returns a Boolean value. True if the default action associated with the event can be canceled using the preventDefault() method, fasle otherwise.
Syntax
event.cancelable
Example
Example
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script> function myFunction(e){ alert(e.cancelable); } </script> </head> <body> <p onclick="myFunction(event)">单击这个段落,如果事件是可以取消的将弹出警告框。</p> </body> </html>
Run Instance»
Click the "Run Instance" button to view the online instance