Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

HTML onshow Event Attribute

❮ HTML Event Attributes

Example

Execute a JavaScript when a <menu> element is shown as a context menu:

<div contextmenu="mymenu">
  <p>Right-click inside this box to see the context menu!
  <menu type="context" id="mymenu" onshow="myFunction()">
    <menuitem label="Refresh" onclick="window.location.reload();"></menuitem>
  </menu>
</div>
Try it Yourself »

Definition and Usage

The onshow attribute fires when a <menu> element is shown as a context menu.


Browser Support

The numbers in the table specify the first browser version that fully supports the event attribute.

Event Attribute
onshow Not supported Not supported 8.0 Not supported Not supported

Syntax

<element onshow="script">

Attribute Values

Value Description
script The script to be run on onshow

Technical Details

Supported HTML tags: <menu>

Related Pages

HTML DOM reference: onshow event


❮ HTML Event Attributes