A drop-down list with three visible options.
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.
Note: In Chrome and Safari, this attribute may not work as expected for size="2"
and size="3"
.
<select size="number">
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 |
Example:
HTML
<label for="cars">Choose a car:</label>
<select name="cars" id="cars" size="3">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
Type: | Html |
Category: | Web Tutorial |
Sub Category: | HTML Tag |
Uploaded by: | Admin |