定义与用法
The select element creates a drop-down list.
select元素可建立下拉列表
--------------------------------------------------------------------------------
在HTML和XHTML中的区别
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> Volvo Saab Opel Audi
--------------------------------------------------------------------------------
可选属性
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
The select element creates a drop-down list.
select元素可建立下拉列表
--------------------------------------------------------------------------------
在HTML和XHTML中的区别
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> Volvo Saab Opel Audi
--------------------------------------------------------------------------------
可选属性
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