How to clear all the input in HTML forms?

HTMLWeb DevelopmentFront End Technology

Using HTML forms, you can easily take user input. The <form> tag is used to get user input, by adding the form elements. Different types of form elements include text input, radio button input, submit button, etc.

The <input> tag, helps you to take user input using the type attribute. To clear all the input in an HTML form, use the <input> tag with the type attribute as reset.


You can try to run the following code to clear all the input in HTML forms −

Live Demo

<!DOCTYPE html>
         Student Name:<br>
         <input type="text" name="sname">
         Student Subject:<br>
         <input type="text" name="ssubject">
         <input type="reset" value="reset">
Published on 07-Feb-2018 12:24:27