Example: The following HTML source code defines a section with a context menu. The menu has two items and a sub-menu with two items.
<section id="noninteractive" contextmenu="imagemenu"> <img src="html5.png" alt="HTML5" id="menudemo"> <menu type="context" id="imagemenu"> <menuitem label="rotate" onclick="rotate()" icon="arrow_rotate_clockwise.png"> </menuitem> <menuitem label="resize" onclick="resize()" icon="image-resize.png"> </menuitem> <menu label="share"> <menuitem label="twitter" onclick="alert('not yet')"> </menuitem> <menuitem label="facebook" onclick="alert('not yet')"> </menuitem> </menu> </menu> </section>Naturally, you don’t need to rely on inline event handlers, all usual registration methods are available. When the context menu is activated, it looks like this:
The article also covers: