Search w3schools.com:

SHARE THIS PAGE

HTML <select> size Attribute

HTML select Tag Reference HTML <select> tag

Example

A drop-down list with three visible options:

<select size="3">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="opel">Opel</option>
  <option value="audi">Audi</option>
</select>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The size attribute is supported in all major browsers.


Definition and Usage

The size attribute specifies the number of visible options in a drop-down list.

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.


Differences Between HTML 4.01 and HTML5

NONE.


Syntax

<select size="number">

Attribute Values

Value Description
number The number of visible options in the drop-down list. Default value is 1. If the multiple attribute is present, the default value is 4


HTML select Tag Reference HTML <select> tag

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]