Translate HTML to Javascript