write refer to vanillajs