Add a Hotkey | JavaScriptSource

Add a Hotkey

Roy Marchand Dec 19, 2007


This script will fire an event when the key specified in the variable "key1" is pressed. In this example, pressing the spacebar will trigger the display of an alert box.


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: addHotkey.js


Paste this code into the HEAD section of your HTML document.

Leave a Response