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

260
Views
javascript error message document.getElementsByClassName(...).getElementsByClassName is not a function

I have a html page that is structured as following:

<html>
    <div class="container-xl">
        <div class="row">
            <div class "element_i_want_to_access">
                ...
            </div>
        </div>
    </div>
</html>

I would like to remove this element, so my approach was as following:

parent_element= document.getElementsByClassName("container-xl").getElementsByClassName('row');
element = document.getElementsByClassName("element_i_want_to_access")
parent_element.removeChild(element );

However, when retrieving the parent element I get the error document.getElementsByClassName(...).getElementsByClassName is not a function. Is there a particular reason for this? What would the correct syntax look like?

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!