# Canceling Events

A handler can cancel what the browser would do next, such as sending a form that failed validation, by calling preventDefault() on the event object the browser passes in.

![Cheat sheet: Canceling Events](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/f02644621e6c4150bb2b37e5b2621998.webp)

- Category: JavaScript
- Level: Journeyman
- Tags: JavaScript, preventDefault()
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/common-events-cancelling-events-cheat-sheet
