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

64
Views
my deleted items is deleting from my to do list page ui but it deleting the wrong item in my local storage
 Links.splice(Links.indexOf(linkIndex),1);

it is not finding the indexOf the element i clicked on in local storage and it is deleting local storage from the back what am i doing wrong please

ulEl.addEventListener("click",function(e) {
     const item = e.target;

     if(item.classList.contains("bin-img")){
         const link = item.parentElement.parentElement.parentElement;
         link.remove()
         function removeLocalLink(link) {
             let Links;
             if (localStorage.getItem("Links") === null) {
                 Links = [];
             } else {
                 Links = JSON.parse(localStorage.getItem("Links"));
             }
             const linkIndex = link.children[2].textContent;
             console.dir(linkIndex)
             Links.splice(Links.indexOf(linkIndex),1);
             console.dir( Links.splice(Links.indexOf(linkIndex),1))

             localStorage.setItem("Links", JSON.stringify(Links));
         }
         removeLocalLink(link)
    }
}
about 4 years ago · Juan Pablo Isaza
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!