Easy Tutorial
❮ Att Basefont Size Att Iframe Seamless ❯

HTML contextmenu Attribute

HTML Global Attributes

Example

Specifies the context menu for a <div> element. The context menu will be displayed when the user right-clicks the element:


Browser Support

Currently, only Firefox supports the contextmenu attribute.


Definition and Usage

The contextmenu attribute specifies the context menu for an element. The context menu will be displayed when the user right-clicks the element.

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


Differences Between HTML 4.01 and HTML5

The contextmenu attribute is new in HTML5.


Syntax

Attribute Values

Value Description
menu_id The id of the <menu> element to be opened.

❮ Att Basefont Size Att Iframe Seamless ❯