Latest web development tutorials

HTML DOM Input URL size property

Input URL Object Reference Input URL objects

Examples

Modify the length of the URL field:

document.getElementById ( "myURL") size = "50".;

try it"

Definition and Usage

size property sets or returns the value of the URL field size property.

size attribute describes the length of the URL field (number of characters).

The default value is 20.

Tip: If you need to set the url field allows you to enter the maximum number of characters, use the maxLength property.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the size attribute.

Note: Internet Explorer or Safari browser does not support the use of type = "url" attribute of the HTML <input> elements.


grammar

Returns size properties:

urlObject .size

Set size properties:

urlObject .size = number

Property Value

value description
number Describe the length, number of characters in URL field. The default value is 20.

technical details

return value: Number that is the length of the URL field, characters.


More examples

Examples

Display URL field length (number of characters):

var x = document.getElementById ( "myURL") size.;
x The output is:
30

try it"


Related Pages

HTML Reference Manual: HTML <the INPUT> size attributes


Input URL Object Reference Input URL objects