Skip to content

find

Finds the first descendant matching a selector.

Import:

import 'obsidian-test-mocks/setup';

Signature:

function find(this: HTMLElement, selector: string): HTMLElement

Parameters:

Parameter Type Description
this HTMLElement
selector string The CSS selector to match.

Returns: HTMLElement — The first matching element. The mock throws when nothing matches.