Re: Get selected text and rewrite it

  •  11-25-2005, 4:32 PM

    Re: Get selected text and rewrite it

    Thanks a lot.  I found another way:
       var editor1 = document.getElementById('CE_Editor_ID');
       //Get the editor selection
       var editor1doc = editor1.GetDocument();
       if (editor1doc.selection=="Text")
       {
         selectedhtml = editor1doc.selection.createRange().htmlText;
         alert(selectedhtml);
       }

    However function PasteHTML(html) helps only if I want to replace the whole HTML text in editor. How about "replace selected text with my own"? Thank you in advance.
View Complete Thread