Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<div id=parentelement><div id=childelement>hello world</div></div>
<script>
let removed = false;
childelement.addEventListener('DOMNodeRemoved', () => {
if (!removed) {
removed = true;
childelement.remove();
}
});
parentelement.innerText = 'hello world';
</script>