Link.onKeyPress

JavaScript 1.2+, JScript 1.0+ Nav4+, IE 3+ Syntax

onKeyPress="command"

Description

The onKeyPress event handler for the Link object is used to handle the event when a key is pressed when the focus is set on the link.

Example

Listing 7.367 shows how the onKeyPress event handler is used. The onKeyPress event handler is invoked any time a key is pressed on the link.

Listing 7.367 Example of the onKeyPress Event Handler
 <html> <head> <title> Using the onKeyPress event handler of the Link object</title> </head> <body> Click the link. <form name="form1"> <a href=http://www.mcp.com:80/foo?something#foobar onKeyPress='alert("You pressed the key on the link")'> http://www.mcp.com:80/foo?something#foobar</a> <br><br> </form> ...

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.