title: CKEditor keeps giving undefined error
body: <p>I created a textarea on which I would like to initiate CKEditor. I also have a simple button that  when the user clicks on, the data from the CKEditor will be stored in a variable.</p>
  
  <p>The problem is that I keep getting an undefined error:</p>
  
  <pre><code>TypeError: CKEDITOR.instances.Textarea is undefined
  [Break On This Error]   
  var data = CKEDITOR.instances.Textarea.getData();
  </code></pre>
  
  <p>This has been driving me crazy for the last 3 hours and any help would be greatly appreciated.</p>
  
  <p>Thanks in advance</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id='texteditor-container'&gt;
  &lt;textarea id='texteditor-textarea' name='Textarea'&gt;&lt;/textarea&gt;
  &lt;/div&gt;
  
  //save button
  &lt;a class='texteditor-save-button' href='#'&gt;Save&lt;/a&gt;
  </code></pre>
  
  <p><strong>JQUERY</strong></p>
  
  <pre><code>//enables ckeditor on text area */
  CKEDITOR.replace('Textarea'); 
  
  // clicking save will send  data to database 
  jQuery('.texteditor-save-button').click(function() {
  
  //saves the content of the  editor 
  
  var data = CKEDITOR.instances.Textarea.getData();
  alert(data);    
  
  return false;   
  
  }); //end click
  </code></pre>