我正在尝试使用cleditor清除文本区的值。但是在ajax响应之后就不清楚了。我的代码如下:
<link rel="stylesheet" href="cleditor/jquery.cleditor.css" />
<script src="cleditor/jquery.min.js"></script>
<script src="cleditor/jquery.cleditor.min.js"></script>
<script>$(document).ready(function () { $("#desc").cleditor(); });
</script>
//Ajax Response Function
success: function(response)
{
$("#btnSubmit").attr('value', 'Add');
$("#frm_data")[0].reset();
$("#Comman").show();
}
<label class="col-sm-2 control-label">Description:</label>
<div class="col-sm-10">
<textarea rows="5" cols="5" name="desc" id="desc" class="form-control"> </textarea>
</div>请让我知道我可以为清除ajax响应上的文本区域值做些什么。
发布于 2017-01-10 13:41:45
$("#desc").cleditor()[0].clear();http://jsfiddle.net/M2RS8/495/
发布于 2017-01-10 13:42:09
您可以通过将空值分配给textarea字段来清除textarea字段。它的工作100%为我,我希望它也为你工作。
$('#desc').val('');发布于 2017-01-10 13:47:50
为此,尝试类似$("#desc").val("");
$("#desc").val("");这里#desc是要清除的文本区的id,.val(‘')将它的值设置为’‘-注意’之间的空格;
https://stackoverflow.com/questions/41561812
复制相似问题