bootstrap-wysiwyg Set Content

3.4k views Asked by At

How to set content to bootstrap-wysiwyg editor dynamically with jQuery. I tried

$('.editor').html() and $('.editor').val() 

Seems to like none of them are accepting

2

There are 2 answers

3
vijay On

enter image description hereTry this, $("#editor").html("I am a <b>bold</b> text.");

wysiwyg editor will show as content as expected as below

"I am a bold text"

0
Piusha On

After struggling lot I found the way

var editorObj = $("#description").data('wysihtml5');
var editor = editorObj.editor;
editor.setValue(data.description);