Hide / show on condition in javascript
<p>I want to hide and show a button on a particular condition in JavaScript.</p>

<p>Code:</p>

<pre><code>$(function(){
    // hide the div initially
    $("#a").hide();

    // Check to see if there is 250 in the url
    var bal_amount = document.getElementById('balance_amount');
    if (bal_amount.value &gt; 0) {
        $("#a").show();
    }
});
</code></pre>

<p>HTML</p>

<pre><code>&lt;form&gt;
&lt;input type="text" id="balance_amount"&gt;
&lt;/form&gt;

&lt;image src="image.jpg" id="a"&gt;
</code></pre>

<p>But it doesn't work.</p>
