什么是JavaScript中的onkeyup事件?
释放键时会触发onkeyup事件。
示例
您可以尝试运行以下代码以了解如何在JavaScript中使用onkeyup事件-
<html> <head> <script> <!-- function sayHello() { var str = document.getElementById("subject"); str.value = str.value.toLowerCase(); } //--> </script> </head> <body> <p>Enter subject below in upper case and see what happpens.</p> <input type = "text" onkeyup = "sayHello()" id = "subject"> </body> </html>