2012-06-28 15:29:56 +04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
function boom()
|
|
|
|
{
|
|
|
|
var j = 0;
|
|
|
|
var a = document.getElementById("a");
|
|
|
|
var r = document.createRange();
|
|
|
|
r.setStart(a.childNodes[0], 0);
|
|
|
|
r.setEnd(a.childNodes[1], 0);
|
|
|
|
|
|
|
|
function f()
|
|
|
|
{
|
|
|
|
if (++j >= 2) {
|
2017-01-17 13:50:25 +03:00
|
|
|
document.removeEventListener("DOMNodeRemoved", f);
|
2012-06-28 15:29:56 +04:00
|
|
|
}
|
|
|
|
r.extractContents();
|
|
|
|
}
|
|
|
|
|
2017-01-17 13:50:25 +03:00
|
|
|
document.addEventListener("DOMNodeRemoved", f);
|
2012-06-28 15:29:56 +04:00
|
|
|
|
|
|
|
r.extractContents();
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body onload="boom();">
|
|
|
|
<div id="a"><span><span></span></span>X</div>
|
|
|
|
</body>
|
|
|
|
</html>
|