Article information Article relates to RadEditor "Classic" and "Prometheus" Created by Rumen Jekov, Telerik Last modified 2008/03/24 Last modified by Georgi Popivanov, Telerik
Obtain editor's current selection as html
Very often, when implementing custom tools or dialogs, the developer needs to obtain the current editor selection in HTML form. SOLUTION
RadEditor provides a cross-browser solution for this task - use the GetSelectionHtml()/getSelectionHtml() method and also use the PasteHtml()/pasteHtml() method to replace the html of the current selection.
The example below shows how to obtain the current selection using a custom button, convert it to upper case and then paste it back (replacing the original text).
Article relates to
RadEditor "Classic" and "Prometheus"
Rumen Jekov, Telerik
Last modified by
Georgi Popivanov, Telerik
1.Add the custom CustomSelectionTool button to the editor toolbar by setting the following code in the ToolsFile.xml:
Copyright © 2016, Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.