Page tree
Skip to end of metadata
Go to start of metadata

TextRun extends Element

The API model used to edit text.

Methods

remove()

Removes the Element itself.

IF ALL ELEMENTS ARE REMOVED, ERRORS MAY OCCUR IN SUBSEQUENT OPERATIONS.

var run = editor.getAPIModelById('id');
run.remove();

replace(html)

  • html <String> The HTML String to replace.

Replaces the element itself with the HTML String passed as an argument.

var run = editor.getAPIModelById('id');
run.replace('<span>TextRun replaced</span>');

setText(text)

  • text <String> Text string to set in the paragraph

Set the text string value passed as an argument to the text run.

var run = editor.getAPIModelById('id');
run.setText('This is what goes into the text run.');
  • No labels