I am trying to remove an element from a div on a third party website.
For instance,
<div id="full_size_photo">
<img src="img1">
<img src="img2">
</div>
var imageDiv = document.getElementById("full_size_photo");
imageDiv.removeChild(imageDiv.childNodes[i]);
imageDiv apparently has 5 children ?: S When I 1 img1 is removed properly. When I delete 3 and 4 img2 is deleted ...
Can anyone explain why this is?
As I understand it, I thought the first img tag would be 0 and the second would be 1?
source
share