Reputation: 2830
My javascript binds an event to a specific element like this:
$(document).on('click', '.element-class', function() {
binding_function();
}
I need to bind this way, since the element is on the content which comes with AJAX.
I tried to unbind:
$(".element-class").unbind();
But this doesn't work. How can I unbind this?
Upvotes: 0
Views: 40
Reputation: 451
Check .off
, it's the counterpart of .on
, you can find the documentation here: http://api.jquery.com/off/ . .unbind
is the counterpart of .bind
, so that didn't work here.
Upvotes: 1