Enable/Disable Click event for element using jQuery

events, jquery

Solution

If I understand well, you could do that very simple with the following:

$this.html("Processing...").css({
    "cursor": "wait",
    "pointer-events": "none"
});

Problem

I want Enable/Disable click event on element. I have following code... HTML: ``` <a id="CP" style="cursor: pointer; text-decoration: underline;">Current Processes</a> ``` jQuery: ``` $(document).on("click", "#CP", function(event) { $this = $(this); $this.click(function() { return false; }); $this.html("Processing...").css({ "text-decoration": "none", "cursor": "default" }); $.ajax({ type: 'post', url: 'abc.jsp', success: function(process) { //My code goes here... $this.on("click"); // Here i want to bind or add handler which is fired previously. } }); }); ```

Original source