Created
June 6, 2018 03:06
-
-
Save ricardobrg/51b3ed8f2761a45bf0b787235966ee86 to your computer and use it in GitHub Desktop.
input number maxlength with javascript oninput
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="number" step="1" min="1" max="999" maxlength="3" name="number" inputmode="numeric" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment