The type attribute in <menuitem> tag is used to define the type of commands of the menuitems.
Syntax:
<menuitem type="command|checkbox|radio">Attribute Values:
- command: It has a Default value. It defines a standard order with an action
- checkbox: It defines a command that can be toggled using a checkbox
- radio: It defines a command that can be toggled using a radio button
Note: This attribute is depreciated from HTML 5.
Example: Below HTML code demonstrates the use of type attribute in <menuitem> element.
<!DOCTYPE html>
<html>
<body>
<center>
<h1 style="color:green;">
GeeksforGeeks
</h1>
<h2>HTML <menuitem> type attribute</h2>
<div style="background:green;
border:2px solid black;
padding: 10px;" contextmenu="geeks">
<p>A Computer Science Portal for Geeks</p>
<menu type="context" id="menuID">
<menu label="Share on...">
<menuitem label="Twitter"
type="command"
onclick=
"window.open('//twitter.com/intent/tweet?text='+ window.location.href);">
</menuitem>
<menuitem label="Pinterest"
type="command"
onclick=
"window.open('https://www.pinterest.com/pin/create/button/?url='+ window.location.href);">
</menuitem>
</menu>
<menuitem label="Email This Page"
type="command"
onclick=
"window.location='mailto:?body='+ window.location.href;">
</menuitem>
</menu>
</div>
<p>A Computer Science Portal for Geeks</p>
<hr>
<p>Right click on green div and see the menuitem
</center>
</body>
</html>
Output:

Supported Browser:
- Mozilla Firefox