Getting a Reference to the RadEditor Document Object
The client-side get_document() method provides a reference to the editor's content area document object. By getting a reference to the editor's document object, you can manipulate the selection in the content area, execute browser commands and call low level browser API methods.
The following example demonstrates how to get a reference to the editor's document and apply bold formatting over the selected content:
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<telerik:RadEditor RenderMode="Lightweight" ID="RadEditor1" runat="server">
</telerik:RadEditor>
<button onclick="ApplyBold()" unselectable="on">
Click to apply bold over selection</button>
<script type="text/javascript">
function ApplyBold()
{
var editor = $find("<%=RadEditor1.ClientID%>"); //return a reference to RadEditor
var oDocument = editor.get_document(); //get a reference to the editor's document
oDocument.execCommand("Bold", false, null);
}
</script>
You can find more information about the execCommand method in the following MSDN and Mozilla articles: execCommand Method, Command Identifiers, Rich-Text Editing in Mozilla