Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Handling the Keydown Event</title> </head> <body> <input type="text" onkeydown="alert('You have pressed a key inside text input!')"> <hr> <textarea cols="30" onkeydown="alert('You have pressed a key inside textarea!')"></textarea> <p><strong>Note:</strong> Try to enter some text inside input box and textarea.</p> </body> </html>