网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: HTML :: HTML <optgroup>标签

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

HTML <optgroup>标签


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 浏览:1876 :: ::

Definition and Usage
定义和用法

Defines an option group. This element allows you to group choices. When you have a long list of options, groups of related choices are easier to handle.
定义一个选项组。该元素可以使你选择某个选项组中所对应的选项。如果你的选项列表太长,使用这个方法可以标出具体选项所对应的选项组,从而方便你进行相关选项的选择。


Differences Between HTML and XHTML
HTML和XHTML的不同

NONE 无


Example
案例

Source
源代码
Output
输出结果
<select>
<optgroup label="Swedish Cars">
<option value ="volvo">Volvo</option>
<option value ="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value ="mercedes">Mercedes</option>
<option value ="audi">Audi</option>
</optgroup>
</select>


Required Attributes
必要属性

DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
DTD 包含了DTD中所允许使用的属性。S=严格精确   T=可变动  F=框架结构

Attribute
属性
Value
Description
描述
DTD
label text_label Defines the label for the option group
定义了指定选项组的标签
STF

Optional Attributes
可选属性

Attribute
属性
Value
Description
描述
DTD
disabled disabled Disables the option-group when it first loads
第一次加载时,不执行选项组功能
STF

Standard Attributes
标准属性

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.
如果你想查阅完整的属性描述,可以点击标准属性查阅。

Event Attributes
事件属性

tabindex, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.
如果你想查阅完整的属性描述,可以点击事件属性查阅。

评论 (0) All