jquery remove deattach event code example
Example 1: jquery remove keypress event
$('#foo').unbind("keypress");
Example 2: remove a function added to eventhandler
element.removeEventListener(type, handler);
$('#foo').unbind("keypress");
element.removeEventListener(type, handler);