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

294
Views
I keep getting an Uncaught TypeError: theoldone.parentNode is null

I am trying to clone an element to reset the animation. I've used this bit of code before and it worked perfectly but now it isn't working I have no idea why not. Here is the code:

var justlike = theoldone.cloneNode(true); theoldone.parentNode.replaceChild(justlike, theoldone);

theoldone is a const for the element I want to clone.

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

0

When using .cloneNode() on an element, you only copy its Node. So you cant access its parents since it is a copy and is seperated from its parents.

From Mozilla Wiki:

Return Value

The new Node cloned. The cloned node has no parent and is not part of the document, until it is added to another node that is part of the document, using Node.appendChild() or a similar method.

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!