Jquery WYSIHTML5文本区域内容未被清除
我有一个文本区域id=“myTextArea”,我能够获取文本区域的内容,但一旦用户成功提交数据,我就无法清除内容。我使用wysihtml5插件作为我的文本编辑器。 我的代码如下Jquery WYSIHTML5文本区域内容未被清除,jquery,wysihtml5,Jquery,Wysihtml5,我有一个文本区域id=“myTextArea”,我能够获取文本区域的内容,但一旦用户成功提交数据,我就无法清除内容。我使用wysihtml5插件作为我的文本编辑器。 我的代码如下 <textarea name="def_text" id="myTextArea" class="textarea"></textarea> 但它并没有清除文本区域。 我也尝试过$('#myTextArea').html(''),但它对我不起作用。你可以参考这篇非常好的文章:(礼貌:) 试
<textarea name="def_text" id="myTextArea" class="textarea"></textarea>
但它并没有清除文本区域。
我也尝试过$('#myTextArea').html(''),但它对我不起作用。你可以参考这篇非常好的文章:(礼貌:) 试用
$('#myTextArea').data("wysihtml5").editor.clear();
这对我来说很好。我刚刚用wysihtml5创建了自己的clear textarea。如果其他解决方案不起作用,请尝试此方法
$('.wysihtml5-sandbox, .wysihtml5-toolbar').remove();
$("#yourTextArea").wysihtml5({
toolbar: {
"link": false, //removing link button
"image": false, //removing imagelink button
}
});
$('#yourTextArea').show();
$('#yourTextArea').val('');
$('.wysihtml5-sandbox, .wysihtml5-toolbar').remove();
$("#yourTextArea").wysihtml5({
toolbar: {
"link": false, //removing link button
"image": false, //removing imagelink button
}
});
$('#yourTextArea').show();
$('#yourTextArea').val('');