This project creates a simple webpage that allows users to change the background color by clicking a button. The background color changes to a random color from a predefined list each time the button is clicked. The webpage also displays the selected color code in the heading and remembers the previously chosen colors using localStorage.
- Save the HTML file (index.html)
- Ensure you have Tailwind CSS set up in your project (refer to Tailwind CSS documentation for setup instructions: https://tailwindcss.com/docs/installation).
- Open the HTML file in a web browser.
- Click the button to change the background color.
- HTML
- tailwind css
- javascript
- You can customize the predefined colors in the JavaScript code (const color = [...]).
- This is a basic example and can be extended to include more features, such as additional color options or animations.