开发者

JHtmlArea Set html

I have been using the jhtmlarea for a wysiwyg editor. Most of it is working. Though I can't figure out how to set the html inside of the textarea.

I have t开发者_开发问答ried .html, .val, .attr('value',''), .text, though none of them work.

Any suggestions on how to do this/a better solution?

Thanks


Set the original text area value and call updateHtmlArea:

$('#textAreaID').val(newHtml).htmlarea('updateHtmlArea');


This works for me

$("#yourTextArea").htmlarea('pasteHTML', "HTML to paste");

Hope it helps you and someone else :)


Not sure if this is what you're after but if you mean setting the text inside the jHtmlArea iFrame then you'll need to use the pasteHTML("text to insert"); method.

E.g.

$("#myTextAreaId").htmlarea ({ this.pasteHTML("Here's some programtically entered text."); })

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜