wymeditor set value?

I am trying to set the value of wymeditor textarea,
in API documentation, to set or get the value, the code below is given;

wym.html("<p>Hello, World.</p>");

but this code is not working.

How can I set the value of wymeditor textarea?

thanks.


That code will actually work, assuming that the value of wym is the appropriate WYMeditor instance. For example, something like this will work:

jQuery('.my-text-area').wymeditor();
myWym = jQuery.wymeditors(0);
myWym.html('<p>initial html</p>');

You can also just put the HTML you'd like to start with as the contents of your text area before you initialize wymeditor.

链接地址: http://www.djcxy.com/p/89944.html

上一篇: Froala的所有工具栏按钮

下一篇: wymeditor设定值?