Clear WYSIWYG Contents???

Dec 14, 2009 at 7:31 PM

Simple question....

How do I clear the contents of the WYSIWYG editor after a button click?

$("#sendMessage").click(function(){
     SendMessage();
     //What do I put here to clear the contents?
});

Thanks,

Planecrash

Dec 14, 2009 at 7:43 PM

I can accomplish my goal this way....

$("#commentBox").htmlarea("dispose");
$("#commentBox").html("");
$("#commentBox").htmlarea();

But it feels more like a hack than an actual solution.  Is there a function like "dispose" or "toHtmlString" that clears the contents?

Thanks,

Planecrash

Dec 14, 2009 at 7:59 PM

Actually I was unable to "focus" the cursor on the htmlarea in IE8 with my previous solution.  So I kept trying and stumbled across this method...

$("#commentBox").html("");
$("#commentBox").htmlarea("updateHtmlArea");

Thanks,

Planecrash