How To Remove Dynamically Loaded Images In Javascript
I'm loading in 3 images (named 1.jpg, 2.jpg, 3jpg) dynamically to 3 divs called 'div1', 'div2' and 'div3'. function loadImages() { for (var i = 1; i < 3; i++ ) { var img = docu
Solution 1:
In remove,
document.getElementById(divName).removeChild(document.getElementById(oldImages));
removeChild
takes a DOM element, not an ID.
Post a Comment for "How To Remove Dynamically Loaded Images In Javascript"