HTML - <menuitem> tag



The HTML <menuitem> tag is used for defining a menu item for a menu.

This tag is no longer recommended as it is deprecated and not supported in the HTML5.

Example

Let's look at the following example, where we are going to use the menuitem tag.

<!Doctype html>
<html>

   <head>
      <title>HTML menuitem Tag</title>
   </head>

   <body>

      <div style = "border:1px solid #000; padding:20px;" contextmenu = "clickmenu">
         <p>Right click inside  here....</p>

         <menu type = "context" id = "clickmenu">
            <menuitem label = "Tutorialspoint" onclick = ""></menuitem>
         </menu>
         
      </div>
   </body>

</html>

On running the above code, the output window will pop up displaying the text on the webpage.

Global Attributes

This tag supports all the global attributes described in − HTML Attribute Reference

Specific Attributes

The HTML <menuitem> tag also supports the following additional attributes −

Attribute Value Description
checked HTML-5 checked defines that a menuitem should be checked
command HTML-5
default HTML-5 default a menuitem is marked as a default command
disabled HTML-5 disabled disables a menuitem and cannot be clicked
icon HTML-5 url defines an icon for a menuitem
label HTML-5 text defines a name for a menuitem which is displayed to the user
radiogroup HTML-5 groupname defiens a group of commands out of which only one can be selected
type HTML-5

checkbox

command

radio

defines type of command for a menuitem default is command

Event Attributes

This tag supports all the event attributes described in − HTML Events Reference

Advertisements