HTML CSS examples for HTML Tag:menu
The label attribute specifies a visible label for the menu which is used to label nested menus within a menu.
Value | Description |
---|---|
text | Specifies a visible label for the menu |
The following code shows how to Use of the label attribute:
<!DOCTYPE html> <html> <body> <div style="background:yellow;border:1px solid #cccccc;padding: 10px;" contextmenu="mymenu"> <menu type="context" id="mymenu"> <menuitem label="Refresh" onclick="window.location.reload();" icon="https://www.java2s.com/style/demo/Opera.png"></menuitem> <menu label="Main Menu"> <menuitem label="Sub 1" icon="https://www.java2s.com/style/demo/Firefox.png" onclick="window.open('http://java2s.com/' + window.location.href);"></menuitem> <menuitem label="Sub 2" icon="https://www.java2s.com/style/demo/Google-Chrome.png" onclick="window.open('http://java2s.com/' + window.location.href);"></menuitem> </menu><!--from w w w .j a v a 2 s . co m--> <menuitem label="Item" onclick="window.location='mailto:?body='+window.location.href;"></menuitem> </menu> </div> <p>works in Firefox!</p> </body> </html>