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 theactionURL 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 specifytype="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.