Shift key pressed? : Key Event : Event onMethod JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Event onMethod » 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>



           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Event onMethod
» Key Event