🔰default action
browser ⟩ event ⟩ default action
Many events have a default action associated with them.
event handlers are usually called before the default behavior takes place.
call event.preventDefault() to prevent this normal behavior.
Depending on the browser, some events can’t be intercepted at all. for example:
Chrome:
ctrl+W
orcmd+W
(close current tab) cannot be handled by JavaScript.
Last updated