Shift key pressed? : Key Event « Event « JavaScript DHTML
- JavaScript DHTML
- Event
- Key Event
Shift key pressed?
<html>
<head>
<script type="text/javascript">
function isKeyPressed(event){
if (event.shiftKey==1){
alert("The shift key was pressed!")
}else{
alert("The shift key was NOT pressed!")
}
}
</script>
</head>
<body onmousedown="isKeyPressed(event)">
<p>Click in the document.</p>
</body>
</html>
Related examples in the same category