Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/html_parser/src/mod.ts>DomUtils.getElementById

Port of fb55/htmlparser2 for Deno
Latest
function DomUtils.getElementById
import { DomUtils } from "https://deno.land/x/html_parser@v0.1.3/src/mod.ts";
const { getElementById } = DomUtils;

Parameters

id: string | ((id: string) => boolean)

The unique ID attribute value to look for.

nodes: Node | Node[]

Nodes to search through.

optional
recurse = [UNSUPPORTED]

Also consider child nodes.

Returns

Element | null

The node with the supplied ID.