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