tom
tom

Reputation: 55

Changing font colour of string value

Can't work out how to change the color of this with out placing a color attribute in the tag. I want to change the color of the word "Correct!"

if (Number(array1[i].value) == ((i+1) * number)){
    array2[i].innerHTML = "Correct!";
}

Upvotes: 0

Views: 62

Answers (1)

Danon
Danon

Reputation: 2973

Maybe this?

array2[i].style.color = "blue";

Upvotes: 2

Related Questions