Skip to content
0

katanakit-js / useSetText

Function: useSetText() ​

ts
function useSetText(target, text): void;

Defined in: src/infrastructure/dom/dom.service.ts:437

Sets the textContent of the target element (safe for user input).

Parameters ​

ParameterTypeDescription
targetstring | ElementA CSS selector string or an Element instance.
textstringThe plain text to set.

Returns ​

void

Example ​

ts
useSetText("#greeting", "Hello, world!");

Released under the MIT License.