updating html with js code