updateBodyModel

Release 2.11.0 and above.

Refreshes the edit model based on the .se-contents DOM.

Parameters:

<table> <thead> <tr><th>Name</th><th>Type</th><th>Attribute</th><th>Description</th></tr> </thead> <tbody> <tr> <td><code>options</code></td> <td>Object</td> <td>
{
    skipUndoRedo: false,
    skipRendering: false
}
</td> <td>

Sets options for the APIModel.

  • skipUndoRedo: If true, edits made through this model are not added to undo/redo. The previous undo/redo stack is also cleared.
  • skipRendering: If true, edits made through this model are reflected only in the model and are not rendered to the screen. After all edits are completed, you must separately render via the editor.render() method.
</td> </tr> </tbody> </table>

Example:

var paragraphs = document.querySelectorAll('.se-contents p');
paragraphs.forEach(function (para, index) {
    para.innerText = index + 'test';
});
editor.updateBodyModel();