Source Code:
(back to article)
Submit
Result:
Report an issue
9
1
2
3
4
5
6
7
8
›
⌄
⌄
<
body
>
<
div
>It's the only thing you see, as the next div is removed!</
div
>
<
div
id=
"mydiv"
>you don't see me if I'm removed!</
div
>
</
body
>
<
script
>
const
div
= document.getElementById(
"mydiv"
);
div.remove();
</
script
>
<body> <div>It's the only thing you see, as the next div is removed!</div> <div id="mydiv">you don't see me if I'm removed!</div> </body> <script> const div = document.getElementById("mydiv"); div.remove(); </script>