before change to jQuery