G
G
Good Samaritan2018-02-02 17:08:28
JavaScript
Good Samaritan, 2018-02-02 17:08:28

Why is the tag not being removed from the html?

The code has

<div class="description-program">                   <div style="float:left; margin: 26px 12px 25px 0;">  <div style="width:336px; height:280px;" > ....

I do so
var description=document.getElementsByClassName("description-program");
            alert(description);
            description.remove();

Nothing is deleted, even an alert is not displayed.
Before that, I have another deletion and everything is ok with it
var element=document.getElementsByClassName("form-item form-type-item");
            var count=element.length;
            for(var i=0;i<=count;i++){
                element[0].remove();
            }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2018-02-02
@flx12

description contains an array, you need to go through it in the same way as through element and delete each entry

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question