HTML DOM MenuItem Object
MenuItem Object
The MenuItem object is new in HTML5.
The MenuItem object represents an HTML
**Note:** Currently only the Firefox browser supports
Accessing the MenuItem Object
You can use getElementById() to access an element.
var x = document.getElementById("myMenuItem");
Creating the MenuItem Object
You can create an element using the document.createElement() method.
var x = document.createElement("MENUITEM");
MenuItem Object Properties
| 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 is disabled |
| icon | Sets or returns the image representing 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 |
Standard properties and events
The MenuItem object also supports the standard property and Events
Related Articles
HTML Reference Manual: HTML