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

ctrlKey Event Attribute

ctrlKey Event Attribute

Event Object Reference Event Object


Definition and Usage

The ctrlKey event attribute can return a Boolean value that indicates whether the Ctrl key was pressed and held down when the event occurred.

Syntax

event.ctrlKey=true|false|1|0


Example

Example

The following example alerts whether the "CTRL" key was held down when a mouse button is clicked:

Runoob Tutorial(runoob.com)

Click somewhere in the document. An alert box will tell you whether you pressed the CTRL key.

Try it »


Event Object Reference Event Object