onkeydown与onkeypress的区别_键盘鼠标特效

模板酷站
  •       3/5
  •       1
  •       2
  •       3
  •       4
  •       5
查看演示效果

      织梦DedeCMS视频教程买空间 租服务器 选网硕互联! 无忧站长工具,百度权重一键全查!

      onkeydown与onkeypress的区别,您可以先修改部分代码再运行.

      <html> <head> <title>onkeydown与onkeypress的区别-模板无忧www.mb5u.com</title> <style> body,p{font-size:11px;font-family:Verdana;font-weight:normal;} </style> </head> <body bgcolor="#FFFFFF"> <p><B>onkeypress</B><br> As of Microsoft® Internet Explorer 4.0, the onkeypress event fires and can be canceled for the following keys:<br> <br> Letters: A - Z (uppercase and lowercase)<br> Numerals: 0 - 9<br> Symbols: ! @ # $ % ^ & * ( ) _ - + = < [ ] { } , . / ? \ | ' ` " ~<br> System: ESC, SPACEBAR, ENTER<br> <br> <br> <B>onkeydown</B><br> As of Microsoft® Internet Explorer 4.0, the onkeydown event fires for the following keys:<br> <br> Editing: DELETE, INSERT<br> Function: F1 - F12<br> Letters: A - Z (uppercase and lowercase)<br> Navigation: HOME, END, LEFT ARROW, RIGHT ARROW, UP ARROW, DOWN ARROW<br> Numerals: 0 - 9<br> Symbols: ! @ # $ % ^ & * ( ) _ - + = < [ ] { } , . / ? \ | ' ` " ~<br> System: ESC, SPACEBAR, SHIFT, TAB<br> <br> As of Internet Explorer 5, the event also fires for the following keys:<br> <br> Editing: BACKSPACE<br> Navigation: PAGE UP, PAGE DOWN<br> System: SHIFT+TAB<br> <br> As of Internet Explorer 5, this event can be canceled for the following keys and key combinations by specifying event.returnValue=false:<br> <br> Editing: BACKSPACE, DELETE<br> Letters: A - Z (uppercase and lowercase)<br> Navigation: PAGE UP, PAGE DOWN, END, HOME, LEFT ARROW, RIGHT ARROW, UP ARROW, DOWN ARROW<br> Numerals: 0 - 9<br> Symbols: ! @ # $ % ^ & * ( ) _ - + = < [ ] { } , . / ? \ | ' ` " ~<br> System: SPACEBAR, ESC, TAB, SHIFT+TAB<br> <br> You can cancel all keys that fire the onkeydown event in HTML Applications, including most accelerator keys, such as ALT+F4.<br> <br> In Internet Explorer 4.0, you cannot cancel the onkeydown event, but you can use the onkeypress event to cancel keyboard events.<br> <br> 两个一起按,可以这样:<br> <br> if( window.event.shiftKey && event.keyCode==xx)<br> </p> <BODY> </BODY> </HTML>