UseFocusElement
katanakit-js / useFocusElement
Function: useFocusElement()
Section titled “Function: useFocusElement()”function useFocusElement(target): boolean;Defined in: infrastructure/viewport/viewport.service.ts:247
Focuses an element.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
target |
string | HTMLElement |
An HTMLElement or a CSS selector string. |
Returns
Section titled “Returns”boolean
true if the element was found and focused.
Example
Section titled “Example”useFocusElement("#search-input");