Reputation: 8280
I was wondering if i remove a div which had div's inside of it using :
var div = document.getElementById('main');
div.parentNode.removeChild(div);
Will this also remove all the Divs that are inside of it ? Or will i have to clear innerHTML
first?
Upvotes: 0
Views: 81
Reputation: 40673
If you remove an element from the DOM, you remove its children as well.
Upvotes: 4