Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear Summernote WYSIWYG Editor

I like to know how to clear the Summernote. Here is a link to bootstrap Summernote

http://summernote.org

I try using

$('#MyForm').delay(1000).resetForm(1000);

And

$('#MyForm').trigger("reset");

Also i tried

$('#SummernoteTxt').val(''); 

1st two codes rest the whole form correctly but doesn't seems to clear the Summernote editor. Can anyone point me how to do this.

like image 443
maxlk Avatar asked May 10 '15 19:05

maxlk


People also ask

How do I customize my Summernote toolbar?

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',...

How do I get plain text from Summernote?

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.

Is Summernote editor free?

The Summernote Editor is a free & open-source super simple WYSIWYG editor based on Bootstrap & jQuery. It is a JavaScript library that can be useful to build the WYSIWYG editors online.


1 Answers

You can clear contents with code.

$('#summernote').summernote('code', '');

You can also clear all stored history, with reset after v0.7.3.

$('#summernote').summernote('reset');

Fore more details... http://summernote.org/deep-dive/#reset

like image 50
Hacker Wins Avatar answered Sep 30 '22 23:09

Hacker Wins