YouTip LogoYouTip

Prop Url Size

# Input URL size Property [![Image 8: Input URL Object Reference](#) Input URL Object](#) ## Example Change the length of the URL field: document.getElementById("myURL").size = "50"; [Try it Β»](#) * * * ## Definition and Usage The size property is used to set or return the value of the size attribute of a URL field. The size property describes the length (in number of characters) of the URL field. The default value is 20. **Tip:** If you need to set the maximum number of characters allowed in the URL field, use the (#) property. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The size property is supported by all major browsers. **Note:** Internet Explorer and Safari do not support the HTML element with type="url". * * * ## Syntax Get the size property: _urlObject_.size Set the size property: _urlObject_.size=_number_ ## Property Values | Value | Description | | --- | --- | | _number_ | Describes the length of the URL field, in number of characters. The default value is 20. | ## Technical Details | Return Value: | A number, representing the length of the URL field, in number of characters. | | --- | * * * ## More Examples ## Example Display the length (number of characters) of the URL field: var x = document.getElementById("myURL").size; The _x_ output will be: 30 [Try it Β»](#) * * * ## Related Pages HTML Reference: (#) * * Input URL Object](#)
← Prop Url TypeProp Url Size β†’