Languages
[Edit]
EN

HTML - set number input maximum value

0 points
Created by:
Palpys
464

In this article, we would like to show you how to set the number input element maximum value in HTML.

Quick solution:

// ONLINE-RUNNER:browser;

<label>
  <span>Select the number:</span>
  <input type="number" name="input-name" max="5" />
</label>

 

Practical example

In this example, we use number input element's max attribute to set its maximum value.

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<body>
  <form>
    <label>
      <span>Select the number:</span>
      <input type="number" name="my-number" max="10" />
    </label>
  </form>
</body>
</html>

References

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join