onkeyup

  1. <html>
  2.  
  3. <head>
  4. <script type="text/javascript">
  5. function writeMessage()
  6. {
  7. document.forms[0].mySecondInput.value=document.forms[0].myInput.value
  8. }
  9. </script>
  10. </head>
  11.  
  12. <body>
  13. <p>当键盘按键上升时,会发生 onkeyup 事件。</p>
  14. <form>
  15. 请编写一条消息:<br />
  16. <input type="text" name="myInput" onkeyup="writeMessage()" size="20">
  17. <input type="text" name="mySecondInput" size="20">
  18. </form>
  19. </body>
  20.  
  21. </html>