HTML DOMMenuItemオブジェクト
MenuItemオブジェクト
MenuItemオブジェクトは、HTMLの<menuitem>要素を表します。
注: <menuitem>要素は、現在Firefoxでのみサポートされています。
MenuItemオブジェクトにアクセスする
getElementById()を使用して、<menuitem>要素にアクセスできます。
var x = document.getElementById("myMenuItem");
MenuItemオブジェクトを作成する
document.createElement()メソッドを使用して、<menuitem>要素を作成できます。
var x = document.createElement("MENUITEM");
MenuItemオブジェクトのプロパティ
Property | Description |
---|---|
checked | Sets or returns whether the menu item should be checked |
command | Sets or returns the value of the command attribute of the menu item |
default | Sets or returns whether the menu item should be the default command |
disabled | Sets or returns whether the menu item should be disabled |
icon | Sets or returns an image that represents the menu item |
label | Sets or returns the value of the label attribute of the menu item |
radiogroup | Sets or returns the value of the radiogroup attribute of the menu item |
type | Sets or returns the value of the type attribute of the menu item |
標準のプロパティとイベント
MenuItemオブジェクトは、標準のプロパティとイベントもサポートします。
関連ページ
HTMLリファレンス:HTML <menuitem>タグ