onshow Event

Example

Call a function 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 »

Description

The onshow event occurs 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.

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 »

Technical Details

Bubbles: No
Cancelable: No
Event type: Event
HTML tags: <menu>
DOM Version: Level 3 Events

Related Pages

HTML reference: HTML contextmenu attribute

HTML reference: HTML <menu> tag


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