javascriptjqueryajaxtextareacleditor

Clear Textarea after Ajax Response while using clEditor


I am trying to clear value of text-area using cleditor. but its not clear after the ajax response. My code are below:

<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>

Please let me know what can I do for clear the text area value on ajax response.


Solution

  • $("#desc").cleditor()[0].clear();
    

    http://jsfiddle.net/M2RS8/495/