let html = document.createElement("html");
document.append(html);
// HierarchyRequestError: The operation would yield an incorrect node tree.Document: append() method / notebook
Document: append() 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.append(html);
doc.children; // HTMLCollection [<html>]