HTML DOM MenuItem Object

MenuItem Object

The MenuItem object represents the HTML <menuitem> element.

Note:Only Firefox supports the <menuitem> element.

Accessing a MenuItem Object

You can access the <menuitem> element by using getElementById():

var x = document.getElementById("myMenuItem");

Creating a MenuItem Object

You can create a <menuitem> element by using the document.createElement() method:

var x = document.createElement("MENUITEM");

MenuItem Object Properties

Properties Description
checked Set or return whether the menu item is selected.
command Set or return the command attribute value of the menu item.
default Set or return whether the menu item is the default command.
disabled Set or return whether the menu item is disabled.
icon Set or return the image representing the menu item.
label Set or return the value of the label attribute of the menu item.
radiogroup Set or return the value of the radiogroup attribute of the menu item.
type Set or return the value of the type attribute of the menu item.

Standard Properties and Events

MenuItem Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Reference Manual:HTML <menuitem> Tag