[JavaScript] 让网页中的文本输入框响应键盘按下事件onkeydown →→→→→进入此内容的聊天室

来自 , 2020-12-12, 写在 JavaScript, 查看 110 次.
URL http://www.code666.cn/view/3aaa3db6
  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" onkeydown="myFunction()">
  16.  
  17. </body>
  18. </html>
  19.  
  20. //javascript/7961

回复 "让网页中的文本输入框响应键盘按下事件onkeydown"

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

captcha