Computer >> Computer tutorials >  >> Programming >> HTML

Why do we use reset button in HTML forms?


The reset button is used to reset all the input fields in HTML forms. It gets added using the <input> tag attribute type.

Why do we use reset button in HTML forms?

Example

You can try to run the following code to reset button in HTML forms −

<!DOCTYPE html>
<html>
   <body>
      <form>
         Student Name:<br>
         <input type="text" name="sname">
         <br>
         Student Subject:<br>
         <input type="text" name="ssubject">
         <br>
         <input type="reset" value="reset">
      </form>
   </body>
</html>