The maxlength attribute specifies the maximum number of characters allowed in the element. Limiting the number of characters in a text field of an HTML form alone leads to a poor user experience or unsightly usability. You can not enter more than 5 digit in the text box. Use the example code to validate min and max length of input field using jQuery. set max length in input char; max length in input type number; how to auto new line if text input is a certain length html5; input max length for number; limit the number input; html5 max input length; HTML Form - restricting the length; maxlength input; mdn html limiting line length; html maxlength for input; html max length input number Character counter and countdown. Maxlength W3 schools