捕捉按键的兼容代码

document.onkeydown=keydown;

function keydown(event)

{

if ( !event )

event = window.event;

var keycode = event.KeyCode | event.Which;

alert(keycode);

}

posted @ 2011-01-07 18:09  toxot  阅读(208)  评论(0编辑  收藏  举报