Skip to content

findAllSelf

Finds every element matching a selector, including the element itself.

Import:

import 'obsidian-test-mocks/setup';

Signature:

function findAllSelf(this: Element, selector: string): HTMLElement[]

Parameters:

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

Returns: HTMLElement[] — The element itself first when it matches, followed by the matching descendants. The mock throws when the element matches but is not an HTMLElement.