How to clear Summernote WYSIWYG Editor
Asked Answered
R

4

9

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.

Restrict answered 10/5, 2015 at 19:9 Comment(2)
MAybe this similar question will help #26425842Raye
Great it work. Thank you. Can you added as the answer so i can mark it as the correct answer?Restrict
M
18

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

Myna answered 24/1, 2016 at 12:18 Comment(0)
R
2

As user2314737 pointed out on the link below code work

$('#MyForm').code('');
Restrict answered 11/5, 2015 at 6:27 Comment(0)
H
2

Worked for me, only put below jquery code.

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

Here ControlId is the id of the summernote editor.

Hallelujah answered 22/1, 2016 at 6:14 Comment(1)
Worked for me also,Commute
O
1

Reset

To Clear the editor content and remove all stored history.

$('#summernote').summernote('reset');
Outbuilding answered 9/12, 2020 at 8:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.