简体   繁体   English

如何清除 Summernote 所见即所得编辑器

[英]How to clear Summernote WYSIWYG Editor

I like to know how to clear the Summernote.我想知道如何清除 Summernote。 Here is a link to bootstrap Summernote这是引导 Summernote 的链接

http://summernote.org 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.第一个两个代码正确地保留了整个表单,但似乎没有清除 Summernote 编辑器。 Can anyone point me how to do this.任何人都可以指点我如何做到这一点。

You can clear contents with code .您可以使用code清除内容。

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

You can also clear all stored history, with reset after v0.7.3.您也可以清除所有存储的历史, reset v0.7.3之后。

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

Fore more details... http://summernote.org/deep-dive/#reset欲了解更多详情... http://summernote.org/deep-dive/#reset

正如 user2314737 在代码工作下面的链接上指出的那样

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

Worked for me, only put below jquery code.为我工作,只放在 jquery 代码下面。

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

Here ControlId is the id of the summernote editor.这里ControlId是summernote编辑器的id。

Reset重启

To Clear the editor content and remove all stored history.清除编辑器内容并删除所有存储的历史记录。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM