Sets or gets the maximum number of characters that can be entered.
maxLength property of an input element to a
positive number restricts user input, by manual entry or pasting, to
text that does not exceed the
maxLength. However, it does not limit
your ability to change the element's value to one that exceeds
To remove the maximum length restriction that has been set on the input
maxLength property returns the element's
The number of characters is calculated by Unicode code points.
Was this helpful?
1let maxLen = $w("#myElement").maxLength; // 40
1$w("#myElement").maxLength = 40;
1$w("#myElement").maxLength = 0;