html tutorial - <menu> Menu tag in HTML - html5 - html code - html form
Learn html - html tutorial - menu tag in html - html examples - html programs
- The <menu> tag specifies a list/menu of commands.
- The <menu> tag is applied for context menus, toolbars and for listing form controls and commands.
- The <menu> tag belongs to flow content.
- The <menu> tag supports Global Attributes and Event Attributes.
Syntax for <menu> tag:
Differences between HTML 4.01 and HTML5 for <menu> tag:
HTML 4.01
- The <menu> tag was depreciated.
HTML5
- The <menu> tag is again defined.
Sample Coding for <menu> tag:
Code Explanation for <menu> tag:
- Using contextmenu attribute we can create a context menu for the element.
- <menu> tag is used to
define the list of the commands for menu list. - type=” contextmenu” attribute used to specifies the menu is a context menu.
- label attribute used to define the text which is to be shown in the menu.
Output of <menu> tag:
- Here the output shows the context menu.
Attribute for <menu>tag:
Attribute | Value | HTML4 | HTML5 | Description |
---|---|---|---|---|
label | text | No | Yes | Describes a visible label for the menu. |
type | list toolbar context |
No | Yes | Describes that the type of menu to show. |
Browser Support for <menu> tag:
No | No | Yes | No | No |
Tips and Notes
- The <menu> tag is only supported in Firefox.
- The <menu> tag is only works for context menus.
- To style menu lists use CSS.