Chapter 9: Handling Events

Return to Chapter 9

 

To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.

Key Event Handling: onkeydown

See it run: Key Event Handling: onkeydown

Script 9.19

This HTML creates a simple slide show.

Script 9.20

This JavaScript uses the onkeydown handler to trigger a slide change.

Images:

callisto.jpg
europa.jpg
io.jpg
ganymede.jpg