When I load my page, a nodeList node is created and it looks like this:
[text, h4, text, span, br, input, br, span, br, input, br, span, br, input, br, span, br, input, br]
I created a simple loop forthat iterates over all of these elements and removes each of them from the DOM. (all items are in <section>)
Here's the loop:
for(element in videoTitlesElement.childNodes){
if(!isNaN(element)){
videoTitlesElement.removeChild(
videoTitlesElement.childNodes[element]);
}
}
But, towards the end of the loop, nodeList looks like this:
[h4, span, input, span, input, span, input, span, input]
Not all items are deleted. Why?
Thanks.