ckeditorinline

by sunil puvvada

HTML

<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://cdn.ckeditor.com/4.7.1/standard/ckeditor.js"></script>
<div class="">
  <div class="body" id="editor"></div>
</div>
<p id="dataValue">
get Data
</p>

JavaScript

/* CKEDITOR.disableAutoInline = true; */
 var data = "";
$("#editor").each(function(index) {

  var element_id = $(this).attr('id');
  CKEDITOR.replace(element_id, {
    // customConfig: 'l21_light_config.js',
    on: {
      change: function(event) {
        data = event.editor.getData();
        // alert('Sending: ' + data + ' to ' + comment_id );
        alert(data);
      }
    }
  });
	
});


$("#dataValue").click(function(){
        console.log(data);
    });