altKey 事件属性返回一个布尔值。指示在指定的事件发生时,Alt 键是否被按下并保持住了。
event.altKey=true|false|1|0
下面的例子可提示当鼠标按键被点击时 "ALT" 键是否已被按住:
<html>
<head>
<script type="text/javascript">
function isKeyPressed(event)
{
if (event.altKey==1
)
{
alert("The ALT key was pressed!")
}
else
{
alert("The ALT key was NOT pressed!")
}
}
</script>
</head>
<body onmousedown="isKeyPressed(event)">
<p>Click somewhere in the document.
An alert box will tell you if you
pressed the ALT key or not.</p>
</body>
</html>
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛
Powered by 365建站网 RSS地图 HTML地图
copyright © 2013-2024 版权所有 鄂ICP备17013400号