Skip to content

Modal.setContent method

Modal › setContent

Official

Set the content of the modal.

Signature:

setContent(content: string | DocumentFragment): this

Parameters:

ParameterTypeDescription
contentstring | DocumentFragmentThe content.

Returns: this

Example:

modal.setContent('foo');
const fragment = createFragment();
fragment.createEl('strong', { text: 'foo' });
modal.setContent(fragment);