Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML contextmenu Attribute - Removed


Example

Specify a context menu for a <div> element. The context menu appears when a user right-clicks on the element:

<div contextmenu="mymenu">

<menu type="context" id="mymenu">
  <menuitem label="Refresh"></menuitem>
  <menuitem label="Twitter"></menuitem>
</menu>

</div>
Try it Yourself »

Definition and Usage

The contextmenu attribute specifies a context menu for an element. The context menu appears when a user right-clicks on the element.

The value of the contextmenu attribute is the id of the <menu> element to open.


Browser Support

Attribute
contextmenu Not supported Not supported Yes Not supported Not supported

Syntax

<element contextmenu="menu_id">

Attribute Values

Value Description
menu_id The id of the <menu> element to open

Related Pages

HTML Tutorial: HTML Attributes