When you pass a function to off it attempts to find that specific function as a handler for those events on that element. But since you are passing an anonymous function in both cases, when using on and off they are two new instances of the function even though they both do the same thing. So it will never find the handler to remove. Somewhere behind the scenes imagine that both of those functions have a unique spot in memory, they are not pointing to the same spot since they are anonymous and defined in two areas. By not passing a function to off it will just remove any function attached to that element for those events.