[JavaScript] 网页中文本框响应onkeypress事件 →→→→→进入此内容的聊天室

来自 , 2019-09-08, 写在 JavaScript, 查看 102 次.
URL http://www.code666.cn/view/1371bcce
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script>
  5. function myFunction()
  6. {
  7. alert("You pressed a key inside the input field");
  8. }
  9. </script>
  10. </head>
  11. <body>
  12.  
  13. <p>A function is triggered when the user is pressing a key in the input field.</p>
  14.  
  15. <input type="text" onkeypress="myFunction()">
  16.  
  17. </body>
  18. </html>
  19.  
  20. //javascript/7962

回复 "网页中文本框响应onkeypress事件"

这儿你可以回复上面这条便签

captcha