Friday, May 10, 2019

Handel Multiple Click on Elements JQuery

I have experience that user on the page try to click multiple time on the button, in case of page delay, this is a short way to handle such issue.


This will remove all event handlers:

$(element).off().on('click', function() {
    // function body
});

To only remove registered 'click' event handlers:

$(element).off('click').on('click', function() {
    // function body
});

No comments:

Post a Comment

Your feedback is always appreciated. I will try to reply to your queries as soon as time allows.Please don't spam,spam comments will be deleted upon reviews.