Javascript examples for DOM:Key Event
Handle keydown event for input text field
<html> <head> <script type="text/javascript"> function keypressed(form) { text = form.textbox.value //do any processing on text desired preview.innerHTML = text;//from ww w . j av a2 s . c o m } </script> </head> <body> <form name="myform" action="test.cgi"> <input type="text" id="textbox" name="textbox" onkeydown="keypressed(this.form);"> <input type="submit" value="submit"> </form> <br> <br> <div id="preview"> </div> </body> </html>