How to get ckeditor textarea value using jquery?

I am using ckeditor for textarea but i could not get data from it.Can any one help me?

Default Asked on May 29, 2019 in JQUERY.
Add Comment
1 Answer(s)

 

<script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>

<script src="http://cdn.ckeditor.com/4.5.9/standard/ckeditor.js"></script>
<form>

<textarea name="editor1" id="editor1" rows="10" cols="80">

This is my textarea to be replaced with CKEditor.

</textarea>

<button type="button" id="getDataBtn">Get Data</button>
</form>

<script>
CKEDITOR.replace( 'editor1' );
$(document).ready(function(){
$("#getDataBtn").click(function(){

var editorData= CKEDITOR.instances['editor1'].getData();

alert(" your data is :"+editorData);

})
});

</script>

 

Team Leader Answered on May 29, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.