Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Handling the Keypress Event</title> </head> <body> <input type="text" onkeypress="alert('You have pressed a key inside text input!')"> <hr> <textarea cols="30" onkeypress="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>