Skip to main content
InterviewHubPRO
Section Overview
Q7

Question 7 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

14%
HTML5 & Web APIs (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

What is the difference between `type="submit"`, `type="button"`, and `type="reset"`?

junior LevelhtmlBasic

In Simple Words:

  • <button type="submit"> (Default behavior inside <form>): Submits the form data to the action URL when clicked or when the user presses Enter in an input field.
  • <button type="button">: Does nothing by default. Designed exclusively for JavaScript event listeners (onclick). Always specify type="button" for modal close buttons or tabs inside forms, or clicking them will accidentally submit the form!
  • <button type="reset">: Resets all form fields back to their original default values.