Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

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