首页 > 其他 > 详细

altKey,ctrlKey,shiftKey

时间:2014-07-22 23:44:37      阅读:354      评论:0      收藏:0      [点我收藏+]

<1>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript">

    </script>
</head>
<body>

<!--altKey属性,bool类型,表示发生事件的时候alt键是否被按下-->
<!--ctrlKey属性,bool类型,表示发生事件的时候ctrl键是否被按下-->
<!--shiftKey属性,bool类型,表示发生事件的时候shift键是否被按下-->


<input type="button" value="ctrl点击" onclick="if(window.event.ctrlKey==true){alert('按下了ctrl键')} else{alert('普通点击')}" />

<input type="button" value="alt点击" onclick="if(window.event.altKey==true){alert('按下了alt键')} else{alert('普通点击')}" />


<input type="button" value="shift点击" onclick="if(window.event.shiftKey==true){alert('按下了shift键')} else{alert('普通点击')}" />
</body>
</html>


altKey,ctrlKey,shiftKey,布布扣,bubuko.com

altKey,ctrlKey,shiftKey

原文:http://blog.csdn.net/fanbin168/article/details/38053047

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!