hello,
i have a website where i have images i see people do right click on image and check the exact path of image i want to stop right click on my images so user cannot see the exact path of images. please advice
Hi nauna,
Refer below code.
HTML
<div id="dvDetails"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript"> $('#dvDetails').on('contextmenu', 'img', function (e) { return false; }); </script> <img src="https://i.imgur.com/6LLBMoM.jpg" alt="Alternate Text" /> </div>
Demo
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.