该Alt键的鼠标事件属性是用来显示SHIFT键是否被按下不点击鼠标按钮时。
您可以尝试运行以下代码,以了解如何在JavaScript中实现altKey Mouse事件。
<!DOCTYPE html>
<html>
<body onmousedown="funcAltKey(event)">
<div>Press and hold ALT key and then click here.</div>
<script>
function funcAltKey(event) {
if (event.altKey) {
alert("ALT key: Pressed");
} else {
alert("ALT key: NOT Pressed");
}
}
</script>
</body>
</html>