'button' Example : Mouse : Event JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Event » Mouse »

 

'button' Example



    
<html>
<body>
<script language="JavaScript">
    function function1() {
        var m = window.event.button;
        if (m == 1) { 
            alert("The left button has been pressed")
        else if (m == 2) { 
            alert("The right button has been pressed")
        }
    }
</script>
<div style="width:200; 
            height:200; 
            background-color:blue; 
            color:white;" 
     onmousedown="function1();">
Press on mouse while on top of this blue box.
</div>
</body>
</html>

    
      
      



-

Leave a Comment / Note


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

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Event
» Mouse