A JavaScript function to color a string with a rainbow gradient and add it to the body of the HTML document.