maxlk
maxlk

Reputation: 1057

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.

Upvotes: 9

Views: 16718

Answers (4)

Abd Abughazaleh
Abd Abughazaleh

Reputation: 5535

Reset

To Clear the editor content and remove all stored history.

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

Upvotes: 1

Hacker Wins
Hacker Wins

Reputation: 1289

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

Upvotes: 19

Milan
Milan

Reputation: 3013

Worked for me, only put below jquery code.

$('#ControlId').code('');

Here ControlId is the id of the summernote editor.

Upvotes: 2

maxlk
maxlk

Reputation: 1057

As user2314737 pointed out on the link below code work

$('#MyForm').code('');

Upvotes: 2

Related Questions