<html>
<body onmousedown="isKeyPressed(event)">
<p>请单击文档中的某处。当 onmousedown 事件发生时,警报框会告诉您是否按下了 META 键。</p>
<p><b>提示:</b>在单击文档之前,请尝试按住 META 键(如果它在您的键盘上可用)。</p>
<script>
function isKeyPressed(event) {
if (event.metaKey) {
alert("The META key was pressed!");
} else {
alert("The META key was NOT pressed!");
}
}
</script>
</body>
</html>