HTML size attribute
size attribute defines the visual size of input field (allows the number of characters to show) or the number of options shown to the user.
In the above example a user can see 4 options instead of one. The value indicates the number of options to show.
Attribute values
All possible values of size attributeThe value of this attribute is a valid positive integer.
Related Tags
The tags that support size attribute<input> tag
-
This element allows the user to enter data in the form. It takes part in making the structure of a form to collect the data.
-
The default size of input control is 20. In the above example, the browser allows the user to see 40 characters.
<select> tag
-
This element represents different options in the form of drop down list. One option is selected from this list of options.