replace Javascript with jQuery syntax