Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body onmousedown="isKeyPressed(event)" style="border:1px solid black;padding:8px">
<h1>Mouse Events</h1>
<h2>The altKey Property</h2>
<p>Click in this document.</p>
<p>Click in this document when you hold down the META (Window) key.</p>
<p id="demo"></p>
<script>
function isKeyPressed(event) {
  let text = "";
  if (event.metaKey) {
    text = "The META key was pressed!";
  } else {
    text = "The META key was NOT pressed!";
  }
  document.getElementById("demo").innerHTML = text;
}
</script>
</body>
</html>