how to unbind all event using jquery
You can call .unbind() without parameters to do this: $(‘p’).unbind(); From the docs: In the simplest case, with no arguments, .unbind() removes all handlers attached to the elements.
You can call .unbind() without parameters to do this: $(‘p’).unbind(); From the docs: In the simplest case, with no arguments, .unbind() removes all handlers attached to the elements.
You have to use a named function so you can reference that specific handler when calling .unbind(), like this: function keyUpFunc(e) { if (e.keyCode == 27) { functionZzy(); } } $(document).keyup(keyUpFunc); Then later when unbinding: $(document).unbind(“keyup”, keyUpFunc);