Question · Vibe coding with Claude Code course · Module 3: Twitter clone

Quiz: Forms

Why use e.preventDefault() in onSubmit?

Answer options

  • It clears the form
  • It validates the data
  • It prevents the page from reloading
  • It sends data to the server

You can check the correct answer by solving this task in the CodeWorlds game.