Abakada HTML Demo: onkeypress Event Example


The onkeypress event occurs whenever the user presses a key. This example uses the event to call a function that checks whether the user has pressed the SHIFT key.

Type a few letters in the first text box, with or without the SHIFT key pressed, and note how the function responds in the the lower textbox.

Returns "true" if the shift key is used, and "false" if not.

View Source   Exit

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.