Javascript Reference - HTML DOM MenuItem Object

The MenuItem object represents an HTML <menuitem> element.

The <menuitem> element is currently only supported in Firefox.

Standard Properties and Events

The MenuItem object supports the standard properties and events.


We can access a <menuitem> element by using getElementById().

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

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

var x = document.createElement('MENUITEM');
Property Description
checked check or uncheck the menu item
command Sets or gets the command attribute for the menu item
default Sets or gets whether the menu item should be the default command
disabled disable or enable the menu item
icon Sets or gets an image that represents the menu item
label Sets or gets the label attribute for the menu item
radiogroup Sets or gets the radiogroup attribute of the menu item
type Sets or gets the type attribute of the menu item