
- 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 to clear all the input 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 clear all the input 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>
- Related Questions & Answers
- How do we reset all the input fields in HTML forms?
- How to take user input using HTML forms?
- How do we take password input in HTML forms?
- How to use the submit button in HTML forms?
- HTML DOM forms collection
- How to clear all cookies with JavaScript?
- How to allow multiple file uploads in HTML forms.
- How to clear the memory completely of all Matplotlib plots?
- How to clear all values from the Hash table in PowerShell?
- How we can group data in HTML forms?
- What HTML forms are and how to use them?
- How to clear an input field on focus with CSS?
- How to clear HTML form fields with jQuery?
- How do we use radio buttons in HTML forms?
- How do we use checkbox buttons in HTML forms?
Advertisements