jQuery Lock Plugin – prevent some users from changing content in your page

I am locked too!

What is jQuery Lock Plugin?

With this jQuery plugin you will be able to prevent some users from changing content in your page, using the Chrome Developer Tools for example.

Basic Usage

<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="//cnova.github.io/jquery-lock/release/jquery.lock.min.js"></script>
$( document ).ready(function() {
<h1> I am locked =) </h1>
<p> I am locked too! </p>


You can customize the behavior of the plugin using this options:

Send a custom alert for every change on the locked elements


    alertMessage: "You can`t change this."
  • customHandler(element, updatedHtml, savedHtml) (Function)

Change the behavior of the plugin, insted of replacing every change with the savedHtml.


    customHandler: function(element, updatedHtml, savedHtml) {
        //Block the change  
        //Do something else if the updatedHtml
        console.log('Change blocked %s', updatedHtml);

Original URL: http://feedproxy.google.com/~r/feedsapi/BwPx/~3/xyt9YYdhq2Q/  

Original article

Comments are closed.

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑

%d bloggers like this: