fishAll
Official
Finds all elements that match the selector.
Example:
function element = document.body.createEl('p');element.createEl('strong', { cls: 'foo' });element.createEl('strong', { cls: 'foo' });console.log(fishAll('.foo')); // [<strong class="foo"></strong>, <strong class="foo"></strong>]console.log(fishAll('.bar')); // []Signature:
function fishAll(selector: string): HTMLElement[]Parameters:
| Parameter | Type | Description |
|---|---|---|
selector | string | The selector to find the elements with. |
Returns: HTMLElement[] — An array of all elements that match the selector.
Example:
function element = document.body.createEl('p');element.createEl('strong', { cls: 'foo' });element.createEl('strong', { cls: 'foo' });console.log(fishAll('.foo')); // [<strong class="foo"></strong>, <strong class="foo"></strong>]console.log(fishAll('.bar')); // []