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?