update javascript with DOM helpers