Skip to content

Instantly share code, notes, and snippets.

@tai2
Created January 3, 2024 07:02
Show Gist options
  • Save tai2/15b8c372298a9843b534b11b9de91aed to your computer and use it in GitHub Desktop.
Save tai2/15b8c372298a9843b534b11b9de91aed to your computer and use it in GitHub Desktop.
import {
DOMParser,
Element,
} from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";
const doc = new DOMParser().parseFromString(
`
<h1>Hello World!</h1>
<p>Hello from <a href="https://deno.land/">Deno!</a></p>
`,
"text/html"
)!;
//console.log(doc.body);
const doc2 = doc.cloneNode(true);
console.log(doc2.body);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment