Why not remove the tag from the html?

The code is
....
Doing so
var description=document.getElementsByClassName("description-program");
alert(description);
 description.remove();

Nothing removed, even the alert is not displayed.
Prior to that, I have more removal and with him, OK
var element=document.getElementsByClassName("form-item form-type-item");
 var count=element.length;
 for(var i=0;i<=count;i++){
element[0].remove();
 }
June 8th 19 at 16:43
1 answer
June 8th 19 at 16:45
in description is an array, it must also walk like element, and delete each record
They are all perfectly processed by the same code and remove the other div, but it doesn't work.
Doing so
var element2=document.getElementsByClassName("description-program");
 var count=element2.length;
 for(var i=0;i<=count;i++){
element2[0].remove();
 }

not working - jamal88 commented on June 8th 19 at 16:48
there is always removed first element

element2[0].remove();

need to replace

element2[i].remove(); - Rose_Rodrigu commented on June 8th 19 at 16:51
Yes corrected is not working, I have the feeling that it is this class never sees. Even
alert(document.getElementsByClassName("description-program"))
not popping up - jamal88 commented on June 8th 19 at 16:54
strange closed the previous script tag and it worked - jamal88 commented on June 8th 19 at 16:57
alert does not display arrays, do console.log(document.getElementsByClassName("description-program"))

but if alert is not popping up, then this js is not running... need to check the conditions above. - Rose_Rodrigu commented on June 8th 19 at 17:00
11841132.jpg - Rose_Rodrigu commented on June 8th 19 at 17:03

Find more questions by tags JavaScript