jQuery enable/disble button depending on input field empty or not
<p>HTML</p>

<hr>

<pre><code>&lt;input type="text" id="customerProfileID" maxlength="9"/&gt;

&lt;input id="attachTest" class="attachTemplateButton" type="button" value="Attach Template" onclick="attachTemplateCall();"/&gt;
</code></pre>

<p>jQuery</p>

<hr>

<pre><code>$("input").focusin(function() {

        $(this).keydown(function() {
            $("#attachTest").attr("disabled", true);
        });     
    });
</code></pre>

<p>I have this code in jsfiddle too <a href="http://jsfiddle.net/jeewanaryal/B7xAm/" rel="nofollow">HERE</a>
I was trying to make the button back to enable state if the input field is empty. That means, the button should be enable if input is empty and should be disabled if the input have some value. The code works only when there is value, the button is disabled but when I erase the entered value, the button still stays in disabled state. What am I missing here?</p>
