Disable Right click on Browser using JQuery

In this post i am explaining, how to use JQuery code for disable right click functionality on browser. This is also one of the good JQuery Interview Questions.

Output: 



<html>
<head>
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $(document).bind("contextmenu", function(e) {
                alert('Right click is disabled');
                e.preventDefault(); //or  return false; //
            });
        }); 
    </script>
</head>
<body>
</body>
</html>
Share this post :

Post a Comment

Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.

 
Support : Ranga Rajesh Kumar
Copyright © 2012. ASP.NET Examples - All Rights Reserved
Site Designed by Ranga Rajesh Kumar