Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/dom/elements/the-innertext-and-outertext-properties/innertext-domnoderemoved-crash.html - WPT Dashboard Interop Dashboard
<!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>