YouTip LogoYouTip

Prop Search Size

# Input Search size Property [![Image 8: Input Search Object Reference](#) Input Search Object](#) ## Example Change the length of the search field: document.getElementById("mySearch").size = "50"; [Try it Β»](#) * * * ## Definition and Usage The size property is used to set or return the value of the size attribute of a search field. The size property describes the length (in characters) of the search field. The default value is 20. **Note:** If you need to set the maximum number of characters allowed in the search 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. * * * ## Syntax Return the size property: _searchObject_.size Set the size property: _searchObject_.size=_number_ ## Property Values | Value | Description | | --- | --- | | _number_ | Describes the length of the search field, in characters. The default value is 20. | ## Technical Details | Return Value: | A number representing the length of the search field, in characters. | | --- | * * * ## More Examples ## Example Display the length (in characters) of the search field: var x = document.getElementById("mySearch").size; The output of _x_ will be: 35 [Try it Β»](#) * * * ## Related Pages HTML Reference: (#) * * Input Search Object](#)
← Prop Search TypeProp Search Value β†’