w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



menu type attribute

The type attribute on the menu element:

Toolbar menu ⁄ Popup menu

A toolbar menu: can be created
- if type attribute = "toolbar" OR
- if type attribute is missing, by default the menu creates a toolbar menu: Syntax1 = Syntax2



Valid Syntax 1
1
2
3
4
5
6
7
8
9
10
11
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

<menu type="toolbar">...</menu>

</body>
</html>
Valid Syntax 2
1
2
3
4
5
6
7
8
9
10
11
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

<menu>...</menu>

</body>
</html>


A popup menu: can be created
- if type attribute = "popup" OR
- if type attribute is missing, but the menu elements is child of another menu element who's type attribute = "popup", then the menu element creates a popup menu too (state inherited from its parent): Syntax3 = Syntax4



Valid Syntax 3
1
2
3
4
5
6
7
8
9
10
11
12
13
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

<menu type="popup">
<menu type="popup"> ...</menu>
</menu>

</body>
</html>
Valid Syntax 4
1
2
3
4
5
6
7
8
9
10
11
12
13
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

<menu type="popup">
<menu> ...</menu>
</menu>

</body>
</html>


A popup menu: can be activated
- through the global attribute contextmenu - see this » video demo OR
- through the specific attribute menu from button element


Examples

<menuattribute="value(s)">...<⁄menu>Examples
2.type=popup,
toolbar
<menu type="popup"> ... <⁄menu>
<menu type="toolbar"> ... <⁄menu>

Note: the 2 attributes are not currently supported in browser!

menu intro menu browser display menu syntax