vanilla js version