Skip to content
Related Articles

Related Articles

HTML <menu> type Attribute

View Discussion
Improve Article
Save Article
  • Last Updated : 12 Aug, 2022
View Discussion
Improve Article
Save Article

The type attribute in <menu> element is used to define the type of menu bar. It is also used with the <menuitem> tag which defines the type of commands of the menu items. 


<menu type="list|context|toolbar">

Note: This attribute has been deprecated and is no longer used.

Attribute values: 

  • list: It has a default value. It defines a list of menus that performs some actions when interacting with the user.
  • context: It defines a context menu that will perform an action before interacting with the user.
  • toolbar: It defines a toolbar menu that allows commands, allows the user to interact with the commands immediately.

Example: Below HTML code demonstrates the HTML <menu> type attribute.  


<!DOCTYPE html>
        <h1 style="color:green;">
        <h2>HTML <menu> type attribute</h2>
        <div style="background:green;
                    border:2px solid black;
                    padding: 10px;"
<p>A Computer Science Portal for Geeks</p>
            <menu type="context" id="menuID">
                <menu label="Share on...">
                    <menuitem label="Twitter"
"'//'+ window.location.href);">
                    <menuitem label="Pinterest" onclick=
                <menuitem label="Email This Page"
                    + window.location.href;">
<p>A Computer Science Portal for Geeks</p>
<p>Right click on green div and see the menuitem


HTML menu type attribute

Supported Browsers 

  • Firefox 8.0

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!