The <menu> tag is used to define a list or menu of commands in HTML5. It can contain more than one <li> or <menuitem> elements.
The <menu> tag is only supported by the latest Mozilla firefox web browsers. This tag also supports the event attributes in HTML5.
Syntax:
<menu> </menu>
Example: The following example demonstrates the <menu> tag with the <li> tag to define the type of list.
<!DOCTYPE html> < html >
< body >
< h1 >< menu > tag Illustration:</ h1 >
< menu >
< li >Problems</ li >
< li >Courses</ li >
< li >Get Hired</ li >
< li >Notifications</ li >
< li >Profile</ li >
</ menu >
</ body >
</ html >
|
Output:
Note: Use a Mozilla Firefox web browser for the output.
Example 2: The following example demonstrates using the <menu> tag with <menuitem> tag to display items.
The <menuitem> tag is not supported in the latest version of HTML i.e, HTML5. It is advised to use the previous version for the output.
Syntax:
<menu> <menuitem> </menuitem> </menu>
<!DOCTYPE html> < html >
< body >
< h1 >< menuitem > tag Illustration:</ h1 >
< menu >
< menuitem >Problems</ menuitem >
< menuitem >Courses</ menuitem >
< menuitem >Get Hired</ menuitem >
< menuitem >Notifications</ menuitem >
< menuitem >Profile</ menuitem >
</ menu >
</ body >
</ html >
|
Output:
Note: Use a Mozilla Firefox web browser for the output.