asp.net.ph

oncontextmenu Event

DHTML Events


Fires when the user clicks the right mouse button in the client area.

Syntax


Inline HTML <element oncontextmenu = "handler" ... > All platforms
Event property object.oncontextmenu = handler JScript™ (compatible with ECMA-262 language specification) only
Named script <script FOR=object EVENT=oncontextmenu> Internet Explorer® only

Remarks


Bubbles Yes
Cancels Yes
To invoke Right-click the object.
Default action Opens the context menu. To cancel the default behavior, set the returnValue property of the event object to FALSE.

Event Object Properties

While event handlers in the Document Object Model do not receive parameters directly, the handler can query the event object for data.

Event Object Properties


Example

This example demonstrates use of the oncontextmenu event to cancel its default action, though the event is typically used to trigger a function that will show a custom menu instead.

Sample Code


Applies To

document




Contents
HTML Elements
HTML Element Attributes
CSS Attributes
DOM Objects
DOM Object Properties
DOM Events Reference
DOM Methods Reference
DOM Collections Reference
 

Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph