let html = document.createElement("html");
document.prepend(html);
// HierarchyRequestError: The operation would yield an incorrect node tree.Document: prepend() method / notebook
Document: prepend() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
let doc = new Document();
let html = document.createElement("html");
doc.prepend(html);
doc.children; // HTMLCollection [<html>]