
使用onkeyup属性。 onkeyup 属性在用户释放按键时触发。
示例
您可以尝试运行以下代码来执行释放按键时的脚本-
<!DOCTYPE html>
<html>
<body>
<p>Press a key inside the textbox.</p>
<input type = "text" onkeydown = "display()">
<script>
function display() {
alert("You released a key!");
}
</script>
</body>
</html>

