RadEditor for ASP.NET

PasteHtml Send comments on this topic.
Client-side API Reference > Methods > PasteHtml

Glossary Item Box

Pastes an html content to the cursor position.

function PasteHtml (content)

content string The HTML content, that will be pasted in Telerik RadEditor

The following example will show you how to paste content into the editor's content area from an external input button:

ASPX/ASCX Copy Code
<rad:radEditor id= "RadEditor1" runat= "server"></rad:radEditor>
<
input type="button" value="Insert Div" onclick="InsertDiv()" />
<
script type="text/javascript">
function InsertDiv()
{
   var editor =
<%=RadEditor1.ClientID %>; //get a reference to the editor
   editor.PasteHtml('
<span style="border: 1px solid red;background-color: blue;color: white;">sample content</span>');
}
</script>