0
5.8kviews
Write JavaScript program to change background color continuously using button.
1 Answer
1
260views
  • Method setTimeout() set the time of 500 ms for background color change.
  • Function Math.floor(Math.random() * 10) selects any random number from 0 to 9. According to randomly selected number and color value associated with that number is set as background color for 500 ms only.
  • Background color change after every …

Create a free account to keep reading this post.

and 4 others joined a min ago.

Please log in to add an answer.