Skip to content
Related Articles

Related Articles

HTML <menu> label Attribute

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 31 Oct, 2021

The HTML <menu> label Attribute  is used to specify a text value that indicates the visible label name of the menu element Although, this attribute is also used to specify the name of the menu items inside the menu.  


<menu label="text"> 

Attribute Values 

  • text:  It contains a single value that defines the name of the label of the menu


Example: Below code illustrates the use of label attribute with the <menu> tag. ;


<!DOCTYPE html>
        <h1 style="color: green;">
        <h2>HTML <menu> label 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="geeks">
                <menu label="Share on...">
                    <menuitem label="Twitter" onclick=
                    + 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


Supported Browsers:

  • Firefox 8.0

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!