HTML onkeypress event Attribute
Example
<input type="text" onkeypress="myFunction()">
Meaning
The onkeypress attribute specifies the script run when a user presses a key.
Related Keyboard Events
Standard Syntax
<element onkeypress="script">
Browser Support
Status
Attribute Values
Value | Description |
---|---|
script | Specifies the script to be run on onkeypress |
Technical Details
Supported HTML elements:
All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>