Skip to main content
Module

x/lume/deps/dom.ts

🔥 Static site generator for Deno 🦕
Very Popular
Go to Latest
import * as lume from "https://deno.land/x/lume@v2.2.4/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