How to create rainbow text in HTML & CSS & JavaScript

Rainbows are colorful things. They make wonderful backgrounds, logos, but I think they are especially cool in texts. I’m certain that many people would like to use them in their web sites, but until lately there hasn’t been a easy and reliable way to achieve it.