command要素
command要素はユーザー操作のコマンドを受け付けるための要素です。
menu要素はHTML5では2012年12月17日の仕様までは存在しましたが、2013年8月26日の仕様で削除されました。
command要素はtype属性に「command」を指定することで通常のコマンドを、「checkbox」を指定することでon/offの状態を選択できるコマンドを、「radio」を指定することで複数のメニューから1つを選択できるコマンドを指定することができます。未指定の場合は「command」の状態が採用されます。
label属性でコマンドのラベル付を行うことができ、これは必須の属性です。
icon属性ではコマンドを表すアイコンのURLが指定できます。
<menu type="toolbar">
<command type="radio" radiogroup="alignment" checked="checked"
label="Left" icon="icons/alL.png" onclick="setAlign('left')">
<command type="radio" radiogroup="alignment"
label="Center" icon="icons/alC.png" onclick="setAlign('center')">
<command type="radio" radiogroup="alignment"
label="Right" icon="icons/alR.png" onclick="setAlign('right')">
<hr>
<command type="command" disabled
label="Publish" icon="icons/pub.png" onclick="publish()">
</menu>
参考URL
4.11.3 The command element - HTML5 - W3C
登録日 : 2014年06月11日 最終更新日 : 2015年10月7日