DocumentFragment.findAll method
DocumentFragment › findAll
Official
Finds all descendant elements that match the selector.Signature:
findAll(selector: string): Element[]Parameters:
| Parameter | Type | Description |
|---|---|---|
| selector | string | The selector to find the elements with. |
Returns: Element[] — An array of all descendant elements that match the selector.
Remarks:
See bughttps://forum.obsidian.md/t/bug-find-findall-findallself/98108. Example:
const fragment = createFragment();fragment.createEl('strong', { cls: 'foo' });fragment.createEl('strong', { cls: 'foo' });console.log(fragment.findAll('.foo')); // [<strong class="foo"></strong>, <strong class="foo"></strong>]console.log(fragment.findAll('.bar')); // []