$(selector).limitVal(maxLength)
Limits the number of characters a user can type into an <input> element in real-time.
<input>
<input id="username" />
$('#username').limitVal(5);
💡 Now the user cannot type more than 5 characters.
Last updated 1 month ago