Set and get the text from the HtmlEditor using clientside JavaScript

Oct 15, 2010 at 9:58 AM

How can I set and get the text from the HtmlEditor using clientside JavaScript

Oct 15, 2010 at 10:36 AM

Hi,

I found the way to set and get the text from HtmlEditor from clientside javascript.

--- JavaScript code ---

var edtr = $find('Editor1');           // find the editor by id

var text = edtr.GetText();            // get the text from the editor

edtr.SetText('<p>Hi There</p>'); // Set the editor text

edtr.Save();                                        // Save the text in editor