Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML contextmenu attribute

HTML contextmenu attribute

HTML Global Attributes HTML Global Attributes

Example

Specifies the

context menu of an element. The context menu is displayed when the user right-clicks the element:

 

 

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Currently only the Firefox browser supports the contextmenu attribute.


Definition and Usage

The contextmenu attribute specifies the context menu of an element. The context menu is displayed when the user right-clicks the element. /p>

The value of the contextmenu attribute is the id of the

element to be opened.


Differences between HTML 4.01 and HTML5

The contextmenu attribute is new in HTML5.


Syntax

<

element

contextmenu="

menu_id

">

HTML Global Attributes HTML Global Attributes