Is it possible to say to JQuery, hey! unbind any event handlers before adding this one, without making an explicit call to unbind?.
Something like
$("jq selector").click(function() { ...}, true);
Where true means I want to unbind all click handlers set to the element.
I’ve came across this on various occasions and on some had strange behaviours due not unbinding event handlers first.
Thanks.
use the
unbindmethodIf you want to remove all events associated with an element, Call unbind() with no argument and it will removes all handlers attached to the element(s):