My javascript code not working in mozilla firefox
<p>This is my code for making textbox accept number only.</p>

<pre><code>&lt;asp:TextBox ID="txtRotationNo" runat="server" onkeydown="return NumberOnly();" CssClass="textbox"&gt;&lt;/asp:TextBox&gt;

function NumberOnly () {
    if(!(event.keyCode&gt;=48 &amp;&amp; event.keyCode&lt;=57) &amp;&amp; event.keyCode!=8) {
        event.returnValue=null;
    }
}
</code></pre>

<p>This code is working in Chrome and Opera, but not in firefox.</p>

<p>Can you tell me what's wrong with this code?</p>
