Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

HTML <menuitem> disabled Attribute

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The HTML <menuitem> disabled attribute is a boolean attribute that specifies whether the menu item would be disabled or not. The disabled menu item is unclickable and usually, looks greyish in color. 

Syntax:

<menuitem disabled> 

Note: The menuitem disabled Attribute is depreciated from HTML 5.

Example: Below code demonstrates the use of disabled attribute in <menuitem> tag.  

HTML




<!DOCTYPE html>
<html>
   
<body>
    <center>
        <h1 style="color:green;">
            GeeksforGeeks
        </h1>
           
        <h2>HTML <menuitem> disabled 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);" disabled>
                    </menuitem>
                    <menuitem label="Pinterest" onclick=
                    "window.open(
                        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: 

  • Mozilla Firefox 8.0

My Personal Notes arrow_drop_up
Last Updated : 31 Aug, 2022
Like Article
Save Article
Similar Reads
Related Tutorials