English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
the select size attribute specifies the number of visible options in the dropdown list, if the value of the size attribute is greater than1but less than the total number of options in the list, the browser will add a scrollbar to indicate that there are more options available to view.
with4a dropdown list of visible options:
<form action="action_page.php"> <select name="lan" size="2"> <option value="PHP">PHP</option> <option value="Python">Python</option> <option value="C#">C#</option> <option value="Golang">Golang</option> </select> <input type="submit"> </form>Test and see ‹/›
IEFirefoxOperaChromeSafari
In Chrome and Safari, for size = “ 2“and size =” 3“”
The size attribute specifies the number of visible options in the drop-down list.
If the value of the size attribute is greater than1but less than the total number of options in the list, the browser will add a scrollbar to indicate that there are more options available to view.
None.
<select size="number">
Value | Description |
---|---|
number | The number of visible options in the drop-down list. The default value is1. |