title: ckeditor 5 - How do you get the editor data?
body: <p>I have the following div:</p>
  
  <pre><code>&lt;div name="content" id="editor"&gt;
  </code></pre>
  
  <p>I have the following script: </p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () {
          // CKEDITORs
          var myeditor = ClassicEditor
              .create(document.querySelector('#editor'))
              .then(editor =&gt; {
                  console.log(editor);
              })
              .catch(error =&gt; {
                  console.error(error);
              });
      });
  
      const data = editor.getData();
      const data = myeditor.getData();
  
  &lt;/script&gt;
  </code></pre>
  
  <p>From the documentation, I thought I would be able to do the following:</p>
  
  <pre><code>const data = editor.getData(); //fails with editor.getData is not a function
  </code></pre>
  
  <p>So added the myeditor var as above and tried this:</p>
  
  <pre><code>myeditor.getData();// also fails with same error.
  </code></pre>
  
  <p>How do I get data?</p>