jquery - Reset textbox value and display warning message
<p>i have a textbox and when i enter 0 in it, it should reset to 1 and display warning message.</p>

<p>i tried with blur() and change(), it is working but the problem is, it is displaying warning on coming out of focus from textbox after entering 0..</p>

<p>what i need is as soon as i enter 0 in textbox the warning msg should come</p>

<p>i have attached code what i tried</p>

<pre><code>$("#textbox1").change(function(){
  textboxfunction();
  });

  function textboxfunction(){
    ($("#textbox1").val() == 0) ? $("#warning").show() &amp;&amp; $("#textbox1").val(1) :   $("#warning").hide()
  }
</code></pre>
