I\'m trying to make a webpage change the background color every one second using JavaScript. I\'m using setTimeout but I can\'t figure out how to get my variabl
setTimeout
x = 1; assigns x a value of 1, even in an if statement. Use x == 1 in if statements to keep the value of your variable unchanged.
x = 1;
x
if
x == 1