title: Changing background of TinyMCE editor dynamically using javascript
body: <p>I have a comment field and an input textarea that is a tinymce editor. I have a checkbox named admin only and if that checkbox is clicked the body of tinymce should change color to pink and if it is not ticked it should be white. I used javascript and used onclick method to change it dynamically.</p>
  
  <p>Here is the html code:</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;span&gt;New Comment :&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;textarea&gt;&lt;/textarea&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;div&gt;
      &lt;div align="left"&gt;
          &lt;input name="cbAdmin" type="checkbox" id="cbAdmin" value="Admin" onClick="SetCommentColor()"/&gt;
          &lt;label&gt;Administrator Only&lt;/label&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>And here is the javascript used :</p>
  
  <pre><code>function SetCommentColor() {
      if (document.form2.cbAdmin.checked == true) { 
          color = 'pink';
      } else {
          color = 'white';
      }
      var t = tinyMCE.getInstanceById('eComment');
      t.getBody().style.backgroundColor = color;
  }
  </code></pre>
  
  <p>This doesnt work for me. Can anyone help me on this?</p>