
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do we reset all the input fields in HTML forms?
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.
Example
You can try to run the following code to reset input fields in HTML −
<!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>
- Related Questions & Answers
- Why do we use reset button in HTML forms?
- How do we take password input in HTML forms?
- How to clear all the input in HTML forms?
- How do we use radio buttons in HTML forms?
- How do we use checkbox buttons in HTML forms?
- How do we send an email using HTML forms?
- HTML DOM Input Reset object
- HTML DOM Input Reset name property
- HTML DOM Input Reset type property
- HTML DOM Input Reset value property
- HTML DOM Input Reset autofocus property
- HTML DOM Input Reset disabled property
- HTML DOM Input Reset form property
- How to take user input using HTML forms?
- How do we upload external file on a website using HTML forms?
Advertisements