English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML onshow-Eigenschaft

Wenn ein Element mit dem Attribut contextmenu das Ereignis contextmenu auslöst oder auf das Element bubbling, wird das Ereignis show ausgelöst.

HTML Event Attributes

Online-Beispiel

Wird JavaScript ausgeführt, wenn das <menu>-Element im Kontextmenü angezeigt wird:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>Grund教程(oldtoolbag.com)</title> 
</head>
<body>
<div contextmenu="test"></div>
<menu type="context" id="test">
    <menuitem label="alert" onclick="alert('der Alert-Label wurde geklickt');" />
</menu>
<script>
  document.getElementById("test").addEventListener("show", function(e){
    alert("the context menu will be displayed");
  }, false);
</script>
</body>
</html>
Test and see ‹/›

Definition and Usage

The onshow attribute is activated when the <menu> element is displayed as a context menu.

Browser Compatibility

IEFirefoxOperaChromeSafari

Currently, only the onshow event attribute is supported by the browser firefox.

HTML 4.01 with HTML5 differences

The onshow event attribute is a feature of HTML5new features added.

Syntax

<element onshow="script">

Attribute Value

ValueDescription
scriptThe script is executed in onshow

Technical Details

Supported HTML Tags:<menu>

Related Pages

HTML DOM Reference Manual: onshow Event


HTML Event Attributes