onshowEvent
Examples
Execute JavaScript when the <menu> element is displayed in the context menu:
<div contextmenu="mymenu">
<p>Right-click inside this box to see the context menu!
<p>Right-click the yellow box area to view the context menu!</p>
<menuitem label="Refresh" onclick="window.location.reload();"></menuitem>
</menu>
</div>
<p>Right-click inside this box to see the context menu!
<p>Right-click the yellow box area to view the context menu!</p>
<menuitem label="Refresh" onclick="window.location.reload();"></menuitem>
</menu>
</div>
Try it Yourself »
Definition and Usage
The onshow event is triggered when the <menu> element is displayed in the context menu.
Browser Support
The numbers in the table specify the first browser version that fully supports the event.
| Event | |||||
|---|---|---|---|---|---|
| onshow | Not supported | Not supported | 8.0 | Not supported | Not supported |
Syntax
In HTML:
<element onshow="myScript">Try it Yourself
In JavaScript:
object.onshow=function(){myScript};Try it Yourself
In JavaScript, using the addEventListener() method:
object.addEventListener("show", myScript);Try it Yourself
Note:Internet Explorer 8 and earlier IE versions do not support theaddEventListener()method.
Technical Details
| Does it bubble: | No |
|---|---|
| Is it cancelable: | No |
| Event type: | Event |
| Supported HTML tags: | <menu> |
Related Pages
HTML Reference:HTML contextmenu Attribute
HTML Reference:HTML <menu> Tag
Event Object Other Extensions