Create a Simple Color Flipper in JavaScript

Photo by Greg Rakozy on Unsplash

In this article, we are going to build a simple color flipper which will change the background to a random color, on the click of a button.

We are going to do this project in codepen. So, open any codepen and put this basic html and css. In the html, we have a container class wrapping a h2 and button.

In the CSS, we are placing the main at the center. Also, adding basic styles for h2 and color.

codepen

You can read the rest of the article from my blog site here.

You can find the codepen for this project here.