document.onKeyUp

JavaScript1.0+, JScript1.0+ Nav2+, IE3+ Syntax

document.onKeyUp

Description

The onKeyUp event handler specifies what should happen when any key is pressed and then released when the Document object is in focus.

Example

In Listing 7.150, the script in the <head> of the document specifies a function to handle all KeyUp events in the document. To be able to do this, the document's captureEvents() method is used to capture all events of type Event.KEYUP. When any key is pressed and then released within the page, the document's event handler generates an alert box notifying the user of the event.

Listing 7.150 Handle the KeyUp Event with the onKeyUp Event Handler
 <html> <head> <script language="JavaScript1.2"> <!-- Hide ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.