Get the maximum number of characters allowed in a specific URL field:
The result of x will be:
The maxLength property sets or returns the value of the maxlength attribute of a URL field.
The maxLength attribute specifies the maximum number of characters allowed in the URL field.
The default value is 524288.
Tip: To set or return the width of an URL field, in number of characters, use the size property.
The maxLength property is supported in all major browsers.
Note: The <input type="url"> element is not supported in Internet Explorer 9 and earlier versions, or in Safari.
Return the maxLength property:
Set the maxLength property:
Value | Description |
---|---|
number | Specifies the maximum number of characters allowed in the URL field. Default value is 524288 |
Return Value: | A Number, representing the maximum number of characters allowed in the URL field |
---|
Set the maximum number of characters allowed in a URL field:
HTML reference: HTML <input> maxlength Attribute