HTML 5 <command> 標簽
定義和用法
<command> 標簽定義命令按鈕,比如單選按鈕、復選框或按鈕。
HTML 4.01 與 HTML 5 之間的差異
<command> 標簽是 HTML 5 中的新標簽。
屬性
屬性 | 值 | 描述 |
---|---|---|
checked | true | false | 定義是否被選中。僅用于 radio 或 checkbox 類型。 |
default | true | false | 如果為 true,則被激活。僅用于該 command 位于菜單中時。 |
disabled | true | false | 定義 command 是否可用。 |
hidden | true | false | 定義 command 是否可見。 |
icon | url | 定義作為 command 來顯示的圖像的 url。 |
label | command name | 為 command 定義名稱。label 是可見的。 |
radiogroup | name of radiogroup | 定義該 command 所屬的 radiogroup 的名稱。僅在類型為 radio 時使用。 |
type |
|
定義該 command 的類型。默認是 command。 |
標準屬性
class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title
如需完整的描述,請訪 HTML 5 中標準屬性。
事件屬性
onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload
如需完整的描述,請訪 HTML 5 中事件屬性。