How to Enable/Disable button on TinyMCE textbox onkeyup or onkeydown
<p>on a ascx page I have a tinymce editor and a button</p>

<pre><code>&lt;asp:TextBox ID="txtName" runat="server" Width="100%" &gt;&lt;/asp:TextBox&gt;
&lt;test:tinymceextender runat="server" ID="TinyMceExtender" TargetControlID="txtName" Theme="Full"&gt; &lt;/test:tinymceextender&gt;

&lt;asp:Button ID="btnSave" Text="Save" Enabled="false" runat="server" /&gt;
</code></pre>

<p>I want to check if, textbox is null, then btnsave should be disable, if textbox is not null its should be enable, for the first time its working(because i am checking it on Page_Load), as I am entering some text and deleting that text using backspace btn is in enable mode only. I tried it to do with onKeyUp, onKeyPress but its working working for TinyMCE</p>

<p>these 2 js I used but its not working</p>

<pre><code>$(document).ready(function () {
    document.getElementById('&lt;%=btnSave.ClientID %&gt;').disabled = true;
    var my_editor = tinymce.get('&lt;%=txtName.ClientID %&gt;');
    if ($(my_editor.getBody()).text() == '') {
        $("#&lt;%=btnSave.ClientID %&gt;").attr('disabled', 'disabled');
    }
    else if ($(my_editor.getBody()).text() != '') {
        $("#&lt;%=btnSave.ClientID %&gt;").removeAttr('disabled');
    }
});
</code></pre>

<hr>

<pre><code>window.onload = function () {
    document.getElementById('&lt;%=btnSave.ClientID %&gt;').disabled = true;
}
function ENABLE_BTN() {
    var EN = tinymce.get('&lt;%=txtName.ClientID %&gt;');
    if (EN == '') {
        document.getElementById('&lt;%=btnSave.ClientID %&gt;').disabled = true;
    } else {
        document.getElementById('&lt;%=btnSave.ClientID %&gt;').disabled = false;
    }
}
</code></pre>

<p>calling onkeydown="ENABLE_BTN() on txtName</p>

<p>on F12: my textbox code is looking something like this...</p>

<pre><code>  &lt;fieldset&gt;

  &lt;input id="BasePage_txtName" type="text" style="width: 100%; display: none;"  name="BasePage$txtName" aria-hidden="true"&gt;
  &lt;span id="BasePage_txtName_parent" class="mceEditor defaultSkin" role="application" aria-labelledby="BasePage_txtName_voice"&gt;
  &lt;span id="BasePage_txtName_voice" class="mceVoiceLabel" style="display:none;"&gt;Rich Text Area&lt;/span&gt;
  &lt;table id="BasePage_txtName_tbl" class="mceLayout" cellspacing="0" cellpadding="0" role="presentation" style="width: 100%; height: 100px;"&gt;
  &lt;tbody&gt;
  &lt;tr class="mceFirst" role="presentation"&gt;
  &lt;tr class="mceLast"&gt;
 &lt;/tbody&gt;
   &lt;/table&gt;
  &lt;/span&gt;
  &lt;/fieldset&gt;
</code></pre>
