New to Telerik UI for ASP.NET AJAX? Download free 30-day trial


Returns the currently selected content as plain text in the Telerik RadEditor ContentArea.

function getText()      

This example populates a textbox with the currently selected text:

<telerik:radeditor runat="server" ID="RadEditor1">
       Here is some <span style="color:white;background-color:red;">formatted</span> content.
<asp:TextBox id="TextBox1" runat="server"  />
<script type="text/javascript">
    function populateSelectedText()
        //Get a reference to the client-side RadEditor object:
        var editor = $find("<%=RadEditor1.ClientID%>");
        var theSelectionObject = editor.getSelection();
        //Get the selected text:
        var theSelectedText = theSelectionObject.getText();

        //Get a reference to the textbox:
        var myTextBox = $get("<%=TextBox1.ClientID%>");
        myTextBox.value = theSelectedText;
<input type="button" onclick="javascript:populateSelectedText();" value="Populate the textbox with the selected text!"/> 
In this article