update jQuery snippet