当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <select>标签
The select element creates a drop-down list.
select元素可建立下拉列表
NONE
无
Tip: Use this tag in the form element to accept user input.
提示:可以在form元素中使用这个标签,用来接受用户的输入信息。
代码 | 输出 |
---|---|
<select> <option value ="volvo">Volvo</option> <option value ="saab">Saab</option> <option value ="opel">Opel</option> <option value ="audi">Audi</option> </select> |
DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD属性。S=Strict(精确的),T=Transitional(传统的),F=Frameset(框架)
属性 | 值 | 描述 | DTD |
---|---|---|---|
disabled | disabled | When set, it disables the drop-down list 设置后下拉列表就不可用了 | STF |
multiple | multiple | When set, it specifies that multiple items can be selected at a time 设置后就可以进行多项选择 | STF |
name | unique_name | Defines a unique name for the drop-down list 为下拉列表定义唯一的name | STF |
size | number | Defines the number of visible items in the drop-down list 定义下拉列表可见选项的个数 | STF |
id, class, title, style, dir, lang, xml:lang, accesskey, tabindex |
For a full description, go to Standard Attributes.
查看完整的属性
onfocus, onblur, onchange |
For a full description, go to Event Attributes.
查看完整的属性
Simple drop down box
How to create a simple drop-down box on an HTML page. A drop-down box is a selectable list.
在HTML中建立简单的下拉列表框。
Another drop down box
How to create a simple drop-down box with a pre-selected value.
建立一个已经预选了值的下拉列表框