Languages
[Edit]
EN

HTML - reset input

3 points
Created by:
Wiktor-Sribiew
350

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

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