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

166
Vistas
How to make a timer in js

So I left my old projects and decided to make a website like trello.com it's just a task list site and I wanted to make the task disappear after sometime but I don't know how to create a time I tried to make astring nothing I tried everything I know help Here's the js

//Don't care about the comment code
/*let todos = document.querySelector('ul')
let form = document.querySelector('form')
let idk = document.querySelector("[name='todo']")
let todo = []
*/
let timer = 80
/*function addtodos(todostext) {
  todo.push(todostext)
  const li = document.createElement('li')
  const button = document.createElement('button')
  li.innerHTML = todostext
  button.innerHTML = "done"
  todos.appendChild(li)
  li.appendChild(button)
}
form.onsubmit =(event) =>{
  event.preventDefault();
  addtodos(idk.value)
}*/
function minustimer() {
  --timer;
  
}

document.write(timer)
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

function clearInTimeout(timeSecond) {
    setTimeout(() => {
        // use you code clear
        document.write("clear")
        // 
    }, timeSecond * 1000)
}
clearInTimeout(5); 

the "clear" will be print after 5 seconds

about 4 years ago · Juan Pablo Isaza Denunciar

0

Inside an anonymous function of setInterval, you can remove the task item (instead of my console.log). The item will be removed after a specific amount of time given as a callback of setInterval. Basically, setInterval waits some time to execute a code block. More information in https://developer.mozilla.org/en-US/docs/Web/API/setInterval

function minustimer(){
    setInterval(()=>{
        console.log("Remove the item after 5000 milliseconds")
    },5000)
}

minustimer()
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