Change text color via web string

Hi,

The code used in a web string shown below reads a relay status. If ON it displays ON otherwise, OFF.

....
  s += (stateR[0]) ? "ON" : "OFF";
  s += "
";
  s += "   ";
  s += (stateR[1]) ? "ON" : "OFF";
  s += "
";
....

How would I go by changing the color of the text ON? I know how to do it in a straight html code but this one is not.

TIA.

It's just building straight HTML only in pieces. Now it's just printing "ON" or "OFF" between some
and ugly  ....

Changing color requires understanding of CSS (cascading style sheet)

ieee488:
Changing color requires understanding of CSS (cascading style sheet)

No, it does not. CSS are simply a way if isolating the style from the content. Everything that a CSS can do can be done with straight HTML. I would have thought that perfectly obvious.