Module

x/lume/deps/dom.ts

🔥 Static site generator for Deno 🦕
Very Popular
Go to Latest
import * as mod from "https://dotland.deno.dev/x/lume@v2.3.2/deps/dom.ts";

Examples

Example 1

import { DOMParser, Element } from "jsr:@b-fuze/deno-dom";

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 Function constructor forcing the Sizzle engine. Enables those APIs on platforms like Deno Deploy that don't allow code generation.

Throws if any of the nodes are an ancestor of parentNode