Advertisement
Home Open Editor ❯

HTML onkeydown event Attribute

Example

<input type="text" onkeydown="myFunction()">

Try this code ❯

Meaning

The onkeydown attribute specifies the script run when a user is pressing a key.

Related Keyboard Events


Standard Syntax

<element onkeydown="script">


Advertisement

Attribute Values

Value Description
script Specifies the script to be run on onkeydown

Technical Details

Supported HTML elements:

All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>
Home Open Editor ❯
Advertisement