jQuery implements the method of unbinding the click event after clicking the button only once

  • 2020-06-22 23:49:55
  • OfStack

This article describes the jQuery implementation of the button click once and then cancel the click event binding method. Share to everybody for everybody reference. Specific implementation methods are as follows:

<input type="button" id="my-selector" value=" Only click 1 time " />
$('#my-selector').bind('click', function() {
    alert('Clicked and unbound!');

Hopefully, this article has been helpful in your jQuery programming.

Related articles: