简体   繁体   中英

keypress not working in ie7/8

simple question -

This will not seem to work in ie7/8. http://jsfiddle.net/XvXpE/1/

Any idea why? Or what I can do to fix it?

You can use the document event;

window.onload=function(){
    document.onkeyup=keyUp; 
}
function keyUp(e) {
  e = e || window.event;
  alert(e);
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM