html <command> 标签
实例
标记一个按钮:
<menu>
<command onclick="alert('hello world')">
click me!</command>
</menu>
亲自试一试
浏览器支持
没有浏览器支持 <command> 标签。
只有 internet explorer 9 (更早或更晚的版本都不支持)支持 <command> 标签。
定义和用法
command 元素表示用户能够调用的命令。
<command> 标签可以定义命令按钮,比如单选按钮、复选框或按钮。
只有当 command 元素位于 menu 元素内时,该元素才是可见的。否则不会显示这个元素,但是可以用它规定键盘快捷键。
浏览器支持
目前只有 internet explorer 支持 <command> 标签。
html 4.01 与 html 5 之间的差异
<command> 标签是 html 5 中的新标签。
属性
| checked | checked | 定义是否被选中。仅用于 radio 或 checkbox 类型。 |
| disabled | disabled | 定义 command 是否可用。 |
| icon | url | 定义作为 command 来显示的图像的 url。 |
| label | text | 为 command 定义可见的 label。 |
| radiogroup | groupname | 定义 command 所属的组名。仅在类型为 radio 时使用。 |
| type |
|
定义该 command 的类型。默认是 "command"。 |
全局属性
<command> 标签支持 html 中的全局属性。
事件属性
<command> 标签支持 html 中的事件属性。
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!