changing from javascript to jquery