DEV Community

Discussion on: JavaScript removing HTML tags

Collapse
 
lexlohr profile image
Alex Lohr

Back in the old jQuery days, there was a long discussion if parent.innerHTML = '' or parent.parentNode.replaceChild(parent.cloneNode(), parent) was the better way to remove all children from a node. I believe they went with the latter then.