Open In App
Related Articles

HTML <menu> label Attribute

Improve Article
Improve
Save Article
Save
Like Article
Like

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.  

Syntax:

<menu label="text"> 

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

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. ;

HTML




<!DOCTYPE html>
<html>
 
<body>
    <center>
        <h1 style="color: green;">
            GeeksforGeeks
        </h1>
 
        <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.open('//twitter.com/intent/tweet?text='
                    + window.location.href);">
                    </menuitem>
                    <menuitem label="Pinterest" onclick="window.open(
                        'http://pinterest.com/pin/create/button/?url=' +
                        window.location.href);">
                    </menuitem>
                </menu>
 
                <menuitem label="Email This Page"
                    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 Browsers:

  • Firefox 8.0

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 12 Aug, 2022
Like Article
Save Article
Previous
Next
Similar Reads
Complete Tutorials