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

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

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

Parameters

tagName: string | ((name: string) => boolean)

Tag name to search for.

nodes: Node | Node[]

Nodes to search through.

optional
recurse = [UNSUPPORTED]

Also consider child nodes.

optional
limit = [UNSUPPORTED]

Maximum number of nodes to return.

Returns

Element[]

All nodes with the supplied tagName.