Reputation: 71
What I am trying to do is have something like this
var myVar = "blue"
then do
document.body.style.color = myVar
so the color of body is blue.
Could anyone help me?
Upvotes: 0
Views: 170
Reputation: 4050
That will work to make the text blue. If you wanted to change the background color use backgroundColor
document.body.style.backgroundColor = myVar;
Upvotes: 7