Event Defaults

  • Some HTML elements come with baked in behaviors
    • Links will navigate the browser to another page
    • Submitting forms will sometimes make pages refresh
  • Sometimes it is helpful to turn those off with event.preventDefault
  • Forms are the most common case for this IMO

14 / 17