This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Pretty much the standard equivalent of http://api.jquery.com/empty/ Currently, one has to do something like: element.innerHTML = '';
What's wrong with .textContent = ""? See also bug 17426 and http://krijnhoetmer.nl/irc-logs/whatwg/20120605#l-780
(In reply to comment #1) > What's wrong with .textContent = ""? As much as there is something wrong with node.parentNode.removeChild(node). It's doesn't say what it means. Not everyone is expert enough in the DOM aware of the textContent="" trick and some people just traverse all childNodes to remove them one by one. > See also bug 17426 and > http://krijnhoetmer.nl/irc-logs/whatwg/20120605#l-780 I'm not sure I understand what I should be seeing there. People seem to agree, no? (I'll let others debate on the chaining aspect, I just want the .empty())
*** This bug has been marked as a duplicate of bug 17426 ***