Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body onmousedown="isKeyPressed(event)">
<p>Click somewhere in the document. An alert box will tell you if the META key was pressed when the onmousedown event occured.</p>
<p><strong>Tip:</strong> Try to press and hold down the META key (if it is available on your keyboard) before you click in the document.</p>
<script>
function isKeyPressed(event) {
  if (event.metaKey) {
    alert("The META key was pressed!");
  } else {
    alert("The META key was NOT pressed!");
  }
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_event_mouse_metakey by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:40:08 GMT -->
</html>