Languages
[Edit]
EN

HTML - reset input

3 points
Created by:
Wiktor-Sribiew
800

In this article, we would like to show you how to use reset input button to reset form in HTML.

Quick solution:

<input type="reset" value="Reset Form" />

Note:

The reset input button resets each filed insideform element.

 

Practical example

In this example, we create reset input that appears as a button that resets form to default values (empty strings are default values).

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<body>
  <form>
    <label>
      <span>Username</span>
      <input type="text" name="username" />
    </label>
    <br />
    <label>
      <span>Password</span>
      <input type="password" name="password" />
    </label>
    <br />
    <input type="reset" value="Reset Form" />
  </form>
</body>
</html>

References

Alternative titles

  1. HTML - input reset type
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

HTML - input element types

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join