HTML onshow Attribute


Definition and Usage

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


Applies to

The onshow attribute is part of the Event Attributes, and can be used on the following element:

Elements Event
<menu> onshow

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 »

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

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.