Skip to content

UseFocusElement

katanakit-js / useFocusElement

function useFocusElement(target): boolean;

Defined in: infrastructure/viewport/viewport.service.ts:247

Focuses an element.

Parameter Type Description
target string | HTMLElement An HTMLElement or a CSS selector string.

boolean

true if the element was found and focused.

useFocusElement("#search-input");