Write a JS code to change the background color colour of the webpage automatically after every five seconds. code example

Example 1: how to make a color change every second

local part = --what ever you want it to be
table = {
  Brickcolor.new("Bright Red"),
  Brickcolor.new("Forest Green"),
  Brickcolor.new("Lime Green")
end
while true do
	part.Brickcolor = math.random(table)
end

Example 2: javascript change background color setinterval



Using setInterval()





The setInterval() repeatedly changes the document background color every three seconds.

Tags:

Misc Example