Search code examples
javascripthtmlcssvisual-web-developer

Can we permanently fixed HTML page and cannot edit again?


i want that no one can edit or change my html file especially on browser ???

Try new tips & tricks and get more knowledge about web-development and website design..

want to know more ab HTML , CSS , JAVASCRIPT , PHP , C# , SQL , PYTHON....


Solution

  • You can achieve this by disabling right click Disable Right-Click: While this won't prevent experienced users from modifying your HTML, it can deter casual users. You can add a script to disable the right-click context menu, making it more challenging for users to view or edit the page source.

     html
       <script>
         document.addEventListener('contextmenu', function (e) {
           e.preventDefault();
         });
       </script>
    

    Keep in mind that this is not foolproof and can be bypassed easily.