🚨 Get Your Free NFT Certificate Mint by Completing the Web3 Exam! START NOW

Code has been added to clipboard!

HTML menuitem Tag

Reading time 2 min
Published Jun 29, 2017
Updated Oct 2, 2019

HTML menuitem: Main Tips

  • HTML <menuitem> tag was used to declare a command which the user could request from a popup menu.
  • To set up a new command, you could utilize one or multiple of tag-specific attributes.
  • You could also use the command attribute to connect to other commands.
  • HTML menuitem tag has been deprecated since HTML 5.2.

What <menuitem> Meant

Now unsupported HTML menuitem element defined a command to invoke from the popup menu by the user:

Example
<img src="https://cdn.bitdegree.org/learn/pom-laptop.png?raw=true" id="doggo" width="250" alt="Space Doggo" contextmenu="sunmenu">

<menu type="context" id="sunmenu">
    <menuitem label="Zoom In" icon="https://github.com/bitdegree/banners/blob/master/banners/html_small.png?raw=true" onclick="zoomin()">
    <menuitem label="Zoom Out" icon="https://github.com/bitdegree/banners/blob/master/banners/html_small.png?raw=true" onclick="zoomout()">
    <menuseparator/>
    <menuitem label="Reload Image" icon="https://github.com/bitdegree/banners/blob/master/banners/html_small.png?raw=true" onclick="window.location.reload();">
</menu>

In the example above, you can also see a <menuseparator/> tag which created a HTML menuitem separator. It was a thin line separating the possible commands. When creating a website, HTML menuitem separator could be used to group similar options to simplify the user experience.

DataCamp
Pros
  • Easy to use with a learn-by-doing approach
  • Offers quality content
  • Gamified in-browser coding experience
  • The price matches the quality
  • Suitable for learners ranging from beginner to advanced
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable
Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid Certificates of completion
Udemy
Pros
  • Easy to navigate
  • No technical issues
  • Seems to care about its users
Main Features
  • Huge variety of courses
  • 30-day refund policy
  • Free certificates of completion

Tag Attributes Used With HTML menuitem

There were seven tag-specific attributes to the now unsupported HTML menuitem. See them in the table below:

Attribute Description
radiogroup Defined the name of a group of commands to toggle.
checked Identified the element as checked when the page was loading.
default Set a command as the default one for menuitem.
disabled Disabled the menuitem.
icon Defined an icon for a specific menuitem.
label Defined the menuitem's name to show to the user.
command Indicated the ID of an individual element, pointing to a command to be requested indirectly.
type Defined the menuitem type (command by default).

Browser support

Browser image
Chrome
-
Browser image
Edge
-
Browser image
Firefox
8+
Browser image
IE
-
Browser image
Opera
-
Browser image
Safari
-

Mobile browser support

Browser image
Chrome
-
Browser image
Firefox
8+
Browser image
Opera
-
Browser image
Safari
-