how to change the colour of text inhtml dynamically code example
Example 1: how to change color of font in js
element.style.color = '#f0f';
Example 2: javascript change color
var span = document.getElementsByTagName("span")[0];
span.style.color = "red";