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

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

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

Finds one element in a tree that passes a test.

Parameters

test: (elem: Element) => boolean

Function to test nodes on.

nodes: Node[]

Array of nodes to search.

optional
recurse = [UNSUPPORTED]

Also consider child nodes.

Returns

Element | null

The first child node that passes test.