Input Type: Number

There is a input type which is used for input fields that should contain numeric values. Restrictions can be set on the numerical value, but it depends on the browser's support.

<input type="number">
HTML file: Displayed by browser:
<form>
  Quantity (between 1 and 5):
  <input type="number" name="quantity" min="1" max="5">
  <input type="submit">
</form>
Quantity (between 1 and 5):

You should be able to see your submission in the address field (URL address bar) of your browser.

Back button Table of Contents Next button