Thursday 6 May 2021

JQUERY18

<html>

<head>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<div class="box">Click here</div>

<script>

$(document).ready(function(){        

$('.box').mousedown(function(event) { 

switch (event.which) {

case 1:

$("p").html("Left Mouse Clicked");

break;

case 2:

$("p").html("Middle Mouse Clicked");

break;

case 3:

$("p").html("Right Mouse Clicked");

break;

default:

$("p").html("Option Not Found..");

}

});

}); 

</script>    

</head>

<style>

.box{

padding:100px;

border:3px solid blue;

font-size:30px;

text-align:center;

background-color:pink;

}

</style>

<body>

<div id="container">

 <p></p>

</div>

</body>

</html>