Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 tried .html, .val, .attr('value',''), .text, though none of them work.

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

Thanks

like image 202
Ben Avatar asked Jun 13 '26 08:06

Ben


2 Answers

Set the original text area value and call updateHtmlArea:

$('#textAreaID').val(newHtml).htmlarea('updateHtmlArea');
like image 100
Paul Avatar answered Jun 16 '26 06:06

Paul


This works for me

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

Hope it helps you and someone else :)

like image 22
Mário Rodrigues Avatar answered Jun 16 '26 08:06

Mário Rodrigues



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!