Skip to content

setText

Replaces the element’s children with text or a fragment.

Import:

import 'obsidian-test-mocks/setup';

Signature:

function setText(this: Element, value: string | DocumentFragment): void

Parameters:

Parameter Type Description
this Element
value string | DocumentFragment The new text, or a fragment whose nodes are moved into the element.

Returns: void