1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
export let happyDomExample = (async () => {
const { Window } = await import("npm:@zuisong/happy-dom-deno");
const window = new Window({
url: "https://localhost:8080",
width: 1024,
height: 768,
});
const document = window.document;
document.body.innerHTML = "<div class=\"container\"></div>";
const container = document.querySelector(".container");
const button = document.createElement("button");
container.appendChild(button);
// Outputs "<div class="container"><button></button></div>"
return document.body.innerHTML;
})();