Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Reset button on form not working for javascript?

I am trying to reset every input that has been entered on this form when the "reset" button gets clicked. Below is my code that I tried using, the reset button wont reset anything. Thank you.

    <form id="todoForm">
        <input type="text" id="todoInput" placeholder="Input new note..">
        <input type="text" id="description" placeholder="Input description..">
        <button type="button" id="button" onclick="todoList()">Submit</button>
        <button type="button" id="reset" onclick="resetForm()">Reset</button>
    </form>
    <ol id="todoList">
    </ol>
 
      function todoList() {
    var item = document.getElementById("todoInput").value
    var text = document.createTextNode(item)
    var addItem = document.createElement("li")
    addItem.appendChild(text)
    document.getElementById("todoList").appendChild(addItem)

     var item = document.getElementById("description").value
     var text = document.createTextNode(item)
     var addItem = document.createElement("p")
     addItem.appendChild(text)
     document.getElementById("todoList").appendChild(addItem)
    }

   function resetForm() {
   document.getElementById(todoList).reset();
   }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Don't add a reset button.

Assuming this is a todo app users can just delete the todo after creating it. Adding a reset button probably won't provide much value to users, instead it will most likely frustrate ones that click it by mistake.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!