Best way to remove an event handler in jQuery?
jQuery ≥ 1.7 With jQuery 1.7 onward the event API has been updated, .bind()/.unbind() are still available for backwards compatibility, but the preferred method is using the on()/off() functions. The below would now be, $(‘#myimage’).click(function() { return false; }); // Adds another click event $(‘#myimage’).off(‘click’); $(‘#myimage’).on(‘click.mynamespace’, function() { /* Do stuff */ }); $(‘#myimage’).off(‘click.mynamespace’); jQuery … Read more