时间:2021-07-01 10:21:17 帮助过:5人阅读
document.onclick = function(e){
alert(getKey(e));
};
function getKey(e){
var e = e || window.event;
var keys = [];
if(e.shiftKey){
keys.push("shift键");
};
if(e.ctrlKey){
keys.push("ctrl键");
};
if(e.altKey){
keys.push("alt键");
};
return keys;
};