Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta name="assert" content="Test replaceWith in a cycle">
<link rel="author" title="Euclid Ye" href="mailto:yezhizhenjiakang@gmail.com">
<script>
var oldRoot = document.documentElement;
var newRoot = document.createElement("html");
oldRoot.replaceWith(newRoot);
newRoot.replaceWith(oldRoot);
</script>