Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<script>
var root = document.documentElement;
while(root.firstChild) { root.firstChild.remove(); }
var div = document.createElement("div");
root.appendChild(div);
document.addEventListener("DOMNodeRemoved", function() {
root.appendChild(document.createTextNode("some mutation"));
});
var range = document.createRange();
range.setStart(root, 0);
range.setEnd(root, root.childNodes.length);
range.deleteContents();
</script>