HTML DOM MenuItem Object | MenuItem Object in HTML | How Menu Item Works in HTML

HTML DOM MenuItem Object


MenuItem object

 

The MenuItem object is new to HTML5.

The MenuItem object represents the HTML and menuitem elements.

Note: Currently, only Firefox browsers support the element.

Access the MenuItem object

You can use getElementById() to access the elements:

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

Create a MenuItem object

You can use the document.createElement() method to create an element:

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

MenuItem object properties

Property Describe
checked Whether setting up or returning menu items should be checked
command Set or return the value of the menu item command property
default Set or return whether the menu item should be the default command
disabled Whether the setting or return menu item is disabled
icon Set up or return a picture that represents a menu item
label Set or return the label property value of the menu item
radiogroup Set or return the radiogroup property value for the menu item
type Set or return the type property value of the menu item

Standard properties and events

MenuItem objects also support standard properties and events


Related articles

HTML Reference Manual: HTML.lt; Tags . .