HTML <select> size attribute
HTML <select> tag
Example
The size attribute displays two options in the drop-down list:
<select size="2">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select> |
Try it yourself!
|
Definition and Usage
The size attribute specifies the number of visible options in a drop-down list.
The size attribute is most often used together with the
multiple attribute to define the number of
options to be displayed.
If the value of the size attribute is greater than "1", but lower than the
total number of options in the list, the browser will add a scroll bar to
indicate that there are more options to view.
Browser Support

The size attribute is supported in all major browsers.
Syntax
Attribute Values
Value |
Description |
number |
The number of visible options in the drop-down list |
HTML <select> tag
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|