Archive for tag: jQuery unbind(eventname - function)

Remove events with jquery or javascript

This is the function that we have bound it as below:

    //remove click doSomething

 In jQuery we can do add and remove events as we go along, there are two way that we can remove or unbind event of jQuery

$('div').off('click', doSomething); 
// or 
$('div').unbind('click', doSomething); 

 if is there any batter way then caould yo ucomment down below please,

I hope this would help.