2012-07-09 12:41:47 +04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<script>
|
|
|
|
var root = document.documentElement;
|
2017-03-08 12:17:52 +03:00
|
|
|
while(root.firstChild) { root.firstChild.remove(); }
|
2012-07-09 12:41:47 +04:00
|
|
|
var div = document.createElement("div");
|
|
|
|
root.appendChild(div);
|
|
|
|
|
|
|
|
document.addEventListener("DOMNodeRemoved", function() {
|
|
|
|
root.appendChild(document.createTextNode("some mutation"));
|
2017-01-17 13:50:25 +03:00
|
|
|
});
|
2012-07-09 12:41:47 +04:00
|
|
|
|
|
|
|
var range = document.createRange();
|
|
|
|
range.setStart(root, 0);
|
|
|
|
range.setEnd(root, root.childNodes.length);
|
|
|
|
range.deleteContents();
|
|
|
|
</script>
|