On the page there are many blocks of the same type.
Example:
arr = document.body.getElementsByClassName('box') [<div class=β"box" style=β"background-color:β rgb(122, 233, 132)β;β">β</div>β, <div class=β"box" style=β"background-color:β rgb(133, 154, 188)β;β">β</div>β, <div class=β"box" style=β"background-color:β rgb(59, 243, 75)β;β">β</div>β, <div class=β"box" style=β"background-color:β rgb(175, 245, 235)β;β">β</div>β, <div class=β"box" style=β"background-color:β rgb(56, 211, 118)β;β">β</div>β, ΠΈ Ρ.Π΄.] By the element of the array, we can get a certain block:
arr [i]
I'm wondering how to remove all these blocks from the markup gradually, starting with the last one? In general, how easy is it to remove a block by id?