I got problems getting text back into the summernote editor.
I already tried (but did not work):
$("#EDITsummernote").innerHtml = 'test';
How to do that?
html(text). text(); . Because if you the content of summernote contain some plain text and you don't wrap the whole content inside an HTML tag(like div) then, jQuery will through an error saying it was not expected.
If you look on the main Summernote website as opposed to the API docs you will see a clear example, that explains how to customise the toolbar. It is on the Deep Dive page and scroll down to Custom Toolbar. It also lists the available toolbar buttons. In your toolbar you set ['style', ['bold', 'italic',...
Since v0.7.0 code()
has been deprecated and removed (same story for destroy()
method).
You must use $(".summernote").summernote("code", "your text");
Reference: https://summernote.org/getting-started/#get--set-code
After v0.7.0, direct jquery methods,
destroy
andcode
were removed for avoiding conflict with other jquery libraries. You can call this methods with summernote api.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With