网页编程----js键盘事件小应用

来源:互联网 发布:windows phone磁贴 编辑:程序博客网 时间:2024/05/01 05:42
代码来自PHPFANS管理员blankyao
<HTML>
<BODY>
 
 <script type="text/javascript" language="javascript">
 function mouseOverFunction()
{
        if(window.event.shiftKey && window.event.ctrlKey)
              {
              document.form1.textbox.value="shif and ctrl keys down and mous over at :"+window.event.x+"'"+window.event.y
              }
              return
      
 
}
</script>
 
       <center>
              <form name="form1" action="action">
              <h1>use the mouse in javascript</h1>
              <br/>
              clickthemouse(hold shift ctrl alt)
              <br/>
              <a href="mouse.htm" name="mouselink"
                     onmouseover="mouseOverFunction()"
              >
                     move the mouse please
                     </a>
                     <br/>
                     <br/>
                     <input type="text" name="textbox" size="60"/>
                     </form>
                     </center>
 
</BODY>
</HTML>
 
原创粉丝点击