input type="number" code example
Example 1: html restrict input to numbers
<input type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" />
Example 2: html input box integer only
<input type="number" name="someid" />
Example 3: html5 number integer
<input type="number" step="1" />