Answers for "reset form in react"

1

reset form in react

<!-- you just need a button type of reset -->
<form>
  <div>
   <label for="name">Name</label>
   <input type="text" id="name" placeholder="name" />
  </div>
  <div>
   <label for="password">Password</label>
   <input type="password" id="password" placeholder="password" />
  </div>
  <button type="reset">Reset</button> 
  <button>Submit</button>
</form>
Posted by: Guest on June-12-2021

Browse Popular Code Answers by Language