webfashionist / RichText

WYSIWYG editor developed as jQuery plugin
GNU Affero General Public License v3.0
112 stars 62 forks source link

Changing Contents .val('<div>Something</div>').trigger('change') not working #94

Closed Cumbalin closed 1 year ago

Cumbalin commented 1 year ago

I tried the FAQ suggestion to change the value, but it doesn't seem to be doing anything. <div class="richText><div class="richText-toolbar">...</div><div class="richText-editor"></div><textarea id="ecm_Comments"></textarea></div>

I've tried this: $('#ecm_Comments').val('<div>Something new</div>').trigger('change')

Cumbalin commented 1 year ago

Sorry please ignore this issue - looks like I just found another element using the same #ecm_Comments id. So it was conflicting with setting the .val() and the .trigger('change').