<!DOCTYPE html>
<html lang="en-US">
<body onkeydown="myFunction(event)">
<p>Click on this page once and press altKey or any</p>
<script>
function myFunction(e){
if(e.altKey)
alert("altKey was Pressed");
else
alert("altKey was not Pressed");
}
</script> </body>
</html>