Example #4: Interacting with the document

Creating a simple HTML document from JS.

let p = document.createElement("P");
let t = document.createTextNode("Hello Napier!!!");
p.appendChild(t);
document.body.replaceWith(p);