HTML DOM MenuItemObject
MenuItem Object
The MenuItem object is new in HTML5.
The MenuItem object represents an HTML <menuitem> element.
Note:Currently only Firefox browser supports the <menuitem> element.
Accessing the MenuItem Object
You can use getElementById() to access a <menuitem> element:
var x = document.getElementById("myMenuItem");
Creating a MenuItem Object
You can use the document.createElement() method to create a <menuitem> element:
var x = document.createElement("MENUITEM");
MenuItem Object Properties
| Property | Description |
|---|---|
| checked | Sets or returns whether a menu item should be checked |
| command | Sets or returns the value of the command attribute of a menu item |
| default | Sets or returns whether a menu item should be the default command |
| disabled | Sets or returns whether a menu item is disabled |
| icon | Sets or returns the image representing the menu item |
| label | Sets or returns the value of the label attribute of a menu item |
| radiogroup | Sets or returns the value of the radiogroup attribute of a menu item |
| type | Sets or returns the value of the type attribute of a menu item |
Standard Properties and Events
The MenuItem object also supports the standardAttributesandEvents
Related Articles
HTML Reference Manual:HTML <menitemu> tag
Other Extensions