HTML event onkeydown
Event Attribute onKeyDown
- The user pushes down a key on their keyboard whilst the element is in focus.
In this example, the user will receive a messagebox saying "You pushed down a key on your keyboard", after focusing the element then pushing down a key on their keyboard.
<div onkeydown="alert('You pushed down a key on your keyboard')">Click me then press a key on your keyboard</div>
As this event requires the user to push down a key on the keyboard, users with impaired motor skills or no keyboard (ie. at an information kiosk) may find this difficult or impossible.