-3

Is it possible, using JavaScript or jQuery, to perform an action when a user presses a certain key on the keyboard?

For example: User presses down the "A" key and a div changes from hidden to visible

Thanks

Doug
  • 1
  • yes obvious, but what have you tried so far? – ameenulla0007 Feb 21 '16 at 08:52
  • Welcome to SO. Please visit the [help] to see what and how to ask. Currently the answer to your question is "Yes it is possible" – mplungjan Feb 21 '16 at 08:53
  • See [Detecting arrow key presses in JavaScript](http://stackoverflow.com/questions/5597060/detecting-arrow-key-presses-in-javascript) for examples. – Yogi Feb 21 '16 at 08:57

2 Answers2

0

Sure it is

See the following:

KeyDown Event

KeyPress Event

KeyUp Event

jQuery has wrappers for all these events

Scott Davis
  • 401
  • 3
  • 4
-1

Yes there is a jQuery plugin for just this kind of thing, and also google results are filled with answers.

http://plugins.jquery.com/hotkeys/