The problem isn't the anonymous function but that jquery overrides "this" with the object the event happend on.