paste

Fires before the content is pasted in the Editor.

Event Data

e.html Object

The pasted content

Example - subscribe to the "paste" event during initialization

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  paste: function(e) {
    console.log(e.html);
  }
});
</script>

Example - subscribe to the "paste" event after initialization

<textarea id="editor"></textarea>
<script>
function editor_paste(e) {
  console.log(e.html);
}
$("#editor").kendoEditor();
var editor = $("#editor").data("kendoEditor");
editor.bind("paste", editor_paste);
</script>

Example - process the pasted content

<textarea id="editor"></textarea>
<script>
function onPaste(e) {
  // replace all <a> / </a> tags in the pasted content
  e.html = e.html.replace(/<\/?a[^>]*>/g, "");
}
$("#editor").kendoEditor({
  paste: onPaste
});
</script>
In this article
Not finding the help you need? Improve this article