add random color to each text html code example Example: random text color change in html var randomColor = Math.floor(Math.random()*16777215).toString(16);