JavaScript 獲取按鍵,並屏蔽系統 Window 事件

// JavaScript 獲取按鍵,並屏蔽系統 Window 事件
window.document.onkeydown = onkeydown;
function onkeydown(event) {
    event = (event) ? event : window.event
    if (event.keyCode) {
        alert(event.keyCode);
        event.returnValue = false;
    }
}
相關文章
相關標籤/搜索