<html> <head> <title>Key Event Demo</title> <script> function down() { document.frm1.b1.value="key Down"; } function up() { document.frm1.b1.value="key up"; } </script> </head> <body> <form name="frm1"> <input type="text" name="t1" value="click" onkeydown="down()" onkeyup="up()"> <input type="button" name="b1" value="Press key"> </form> </body> </html>