🔰default action

browserevent ⟩ default action

Many events have a default action associated with them.

// ⭐️ prevent touch screen default actions.
container.addEventListener("touchmove", event => {
        event.preventDefault();
}, {passive: false} );                 // ⭐️ important

Depending on the browser, some events can’t be intercepted at all. for example:

  • Chrome:ctrl+W or cmd+W (close current tab) cannot be handled by JavaScript.

Last updated