Inserts HTML into the editable area. Cleans up MS Word formatting.


html String

The HTML to be inserted.

options Object

Options that configure how the content is processed when pasting.

options.split Boolean (default: true)

Specifies whether the surrounding formatting should be split prior to inserting the HTML. If set to false, the inserted snippet will inherit styles from the surrounding content.


<textarea id="editor"></textarea>
var editor = $("#editor").data("kendoEditor");
editor.paste("<p>New content</p>");

Example - insert text content, preserving formatting

<textarea id="editor">&lt;em&gt;foo&lt;/em&gt;</textarea>
var editor = $("#editor").data("kendoEditor");

// set selection after 'f'
var range = editor.getRange();
range.setStart(editor.body.firstChild.firstChild, 1);

// insert content
editor.paste("bar", { split: false }); // <em>fbaroo</em>
In this article
Not finding the help you need? Improve this article