English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The show event is triggered when the contextmenu event of an element with the contextmenu attribute is triggered or bubbled to the element.
When the JavaScript is executed when the <menu> element is displayed in the context menu:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Basic Tutorial(oldtoolbag.com)</title> </head> <body> <div contextmenu="test"></div> <menu type="context" id="test"> <menuitem label="alert" onclick="alert('the alert label has been clicked')" /> </menu> <script> document.getElementById("test").addEventListener("show", function(e){ alert("the context menu will be displayed"); }, false); </script> </body> </html>Test to see ‹/›
The onshow attribute is activated when the <menu> element is displayed as a context menu.
IEFirefoxOperaChromeSafari
Currently, only the onshow event attribute is supported by the browser firefox.
onshow event attribute is a feature of HTML5new features added in.
<element onshow="script">
Value | Description |
---|---|
script | Script Execution in onshow |
Supported HTML Tags: | <menu> |
---|
HTML DOM Reference Manual: onshow Event