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

x/html_parser/src/utils/legacy.ts>getElementById

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

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.