JSFiddle - React, Tailwind, and code Playground

by Kevin Kamel

HTML

<script src="//cdn.ckeditor.com/4.5.9/standard/ckeditor.js"></script>
  <p>
    <textarea cols="80" id="editor1" name="editor1" rows="10"></textarea>
  </p>

<p>
Content typed above will populate in the below div via the "change" event. However copying and pasting content into CKEditor will cause the very first character to fail to appear.
</p>
  <div id="target" style="border-width:5px; border-style:dashed; min-height: 200px; border-color: #CCC; padding: 25px;"></div>

JavaScript

var ck_instance = CKEDITOR.replace('editor1', {});

    ck_instance.on('change', function() {
      console.log('fired');
      document.getElementById('target').innerHTML = ck_instance.getData();
    });