UseSetText
katanakit-js / useSetText
Function: useSetText()
Section titled “Function: useSetText()”function useSetText(target, text): void;Defined in: infrastructure/dom/dom.service.ts:437
Sets the textContent of the target element (safe for user input).
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
target |
string | Element |
A CSS selector string or an Element instance. |
text |
string |
The plain text to set. |
Returns
Section titled “Returns”void
Example
Section titled “Example”useSetText("#greeting", "Hello, world!");