Change background color between red and green every second

前端 未结 10 1199
终归单人心
终归单人心 2020-12-19 16:10

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

10条回答
  •  醉梦人生
    2020-12-19 16:43

    Your code is missing the closing tag and other issues mentioned above.

    Find below a fix of your code that removes the global variable.

      
          
             
          
          
          
     
    

提交回复
热议问题