correcting my munging of vanilla js syntax and jquery syntax