import * as denoDom from "https://deno.land/x/deno_dom@v0.1.48/deno-dom-wasm-noinit.ts";
Examples
Example 1
Example 1
import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/wasm-noinit";
// ...and when you need Deno DOM's parser make sure you initialize it...
await initParser();
// Then you can use Deno DOM as you would normally
const doc = new DOMParser().parseFromString(
`
<h1>Hello World!</h1>
<p>Hello from <a href="https://deno.land/">Deno!</a></p>
`,
"text/html",
);
const p = doc.querySelector("p")!;
console.log(p.textContent); // "Hello from Deno!"
Functions
Explicitly disable querySelector/All code generation with the | |
Throws if any of the nodes are an ancestor
of | |