最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to clear Summernote WYSIWYG Editor - Stack Overflow

programmeradmin1浏览0评论

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

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.

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.

Share Improve this question edited May 10, 2015 at 19:12 user2314737 29.3k20 gold badges107 silver badges121 bronze badges asked May 10, 2015 at 19:09 maxlkmaxlk 1,0576 gold badges18 silver badges35 bronze badges 2
  • MAybe this similar question will help stackoverflow.com/questions/26425342/… – user2314737 Commented May 10, 2015 at 19:16
  • Great it work. Thank you. Can you added as the answer so i can mark it as the correct answer? – maxlk Commented May 10, 2015 at 19:28
Add a comment  | 

4 Answers 4

Reset to default 19

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

As user2314737 pointed out on the link below code work

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

Worked for me, only put below jquery code.

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

Here ControlId is the id of the summernote editor.

Reset

To Clear the editor content and remove all stored history.

$('#summernote').summernote('reset');
发布评论

评论列表(0)

  1. 暂无评论