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
Remove a class from list item of live collection/ HTMLCollection

I have created a to-do list, but after shifting a list item from ongoing to completed tab, the tick-mark button created using js is also shifted to completed tab.

I have coded in such a way that every list item created in ongoing tab is binded to tick-mark(class).To remove that button, we need to remove the class i.e. binded to list item.

I have tried:

var nextlist = document.getElementById("completed").getElementsByTagName("li");
var j;
for(j = 0; j < nextlist.length; j++){
      nextlist[0].classList.remove("complete");
}
     

but it does not work. And because this is in HTMLCollection, we cannot use querySelectorAll()

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You should replace nextlist[0] to nextlist[j]

var nextlist = document.getElementById("completed").getElementsByTagName("li");
var j;
for(j = 0; j < nextlist.length; j++){
      nextlist[j].classList.remove("complete");
}
    
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!