• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

240
Views
Why (remove child) not working even on direct parent-child relation?

I was trying to run removechild on this HTML code:

But it gives me this error

Uncaught TypeError: Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'.

let list = document.getElementById("cont");
list.removeChild(document.getElementById("heading"));
<div class="container" id="cont">
  <h1 id="heading">Hello</h1>
  <h1>World</h1>
</div>

almost 3 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error