change html to js by following