Try it yourself »
Definition and Usage
The onkeydown event occurs when the user is pressing a key (on the keyboard).
Tip: The order of events related to the onkeydown event:
The onkeydown event is supported in all major browsers.
onkeydown In HTML
The onkeydown attribute can be used within ALL HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>.
Thank You For Helping Us!
Your message has been sent to W3Schools.