<html>
<head>
<style>
div {
background: yellow;
border: 1px solid #cccccc;
padding: 10px;
}
</style>
</head>
<body>
<p>该实例演示了如何使用 addEventListener() 方法向 menu 元素中添加 "onshow" 事件。</p>
<div contextmenu="mymenu">
<p>用鼠标右键单击黄色框区域查看上下文菜单!</p>
<menu type="context" id="mymenu">
<menuitem label="Refresh" onclick="window.location.reload();" icon="ico_reload.png"></menuitem>
<menu label="Share on...">
<menuitem label="Twitter" icon="ico_twitter.png" onclick="window.open('//twitter.com/intent/tweet?text=' + window.location.href);"></menuitem>