Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

178
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda