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

165
Views
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 answers
Answer question

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 Report

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 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!