Integer only input Javascript : <p>I am unsure on how to create an input box that only allows integers to be inputted. I have made a HTML version of the input but I need the same input type within JavaScript.</p>

<p>Here's my current HTML input</p>

<pre><code>&lt;input type="text" autocomplete="off" ondragstart="return false;" ondrop="return false;" onpaste="return false;" onkeypress="return event.charCode &gt;= 48 &amp;&amp; event.charCode &lt;= 57;"&gt;Amount&lt;/input&gt;
</code></pre>
