How to prevent a "0" as the first character when typing in input type number?
<p>I want to prevent 0 as the first character. But when I focusout and focusin again, then I add "2" in the first, it still run, I want should not run.</p>

<p>Here is my HTML</p>

<pre><code>&lt;input type="number" id="test"&gt;
</code></pre>

<p>My JS</p>

<pre><code>$('#test').keypress(function(evt) {
  if (evt.which == "0".charCodeAt(0) &amp;&amp; $(this).val().trim() == "") {
  return false;
   }
});
</code></pre>

<p>Anybody help or suggest what should I do? Thank you.</p>