title: event.preventdefault() not working on change event of textbox
body: <p>Here exactly I am trying to make my textbox to accept only numbers. I am able to detect keyCode but event.preventdefault() is not working.</p>
  
  <p><strong>complete html + javascript</strong></p>
  
  <pre><code>&lt;HTML&gt;
      &lt;HEAD&gt;
          &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              $(document).ready(function () {
                  $("#textbox1").keydown(function(event) {
                      try 
                      {
                          if (event.keyCode &gt;= 48 &amp;&amp; event.keyCode &lt;= 57)
                          {
                              alert("valid number");
                          }   
                          else
                          {
                              event.preventDefault();
                              alert("It's NAN");
                          }
                      }
                      catch(ex) {
                          alert('An error occurred and I need to write some code to handle this!');
                      }
                      event.preventDefault();    
                  });
              });
          &lt;/script&gt;
      &lt;/HEAD&gt;
      &lt;BODY&gt;
          &lt;FORM&gt;
              &lt;input type="text" id="textbox1"&gt;
          &lt;/FORM&gt;
      &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>here is the <a href="http://jsfiddle.net/cRz8g/" rel="nofollow">fiddle</a>.</p>
  
  <p>How do I achieve the same?</p>