Skip to content

A simple Web Page with buttons to change the background color of the body, a container, or both. each button click applies a randomly selected gradient, enhancing the visual experience using JavaScript and CSS.

Notifications You must be signed in to change notification settings

Yashi-Singh-1/Day-38-Change-Background-Color-On-Click

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Change Background Color On-Click

Challenge Description

This challenge demonstrates how to dynamically change the background colors of the body and a container using JavaScript and CSS gradients. The user interface consists of three buttons that allow users to change the background color of the body, the container, or both simultaneously with a random gradient each time a button is clicked.

Preview

Change Background Color On-Click Preview

Live Demo

Check out the live demo here.

Prerequisites

  • Basic HTML, CSS and JavaScript Knowledge

Learning Points

  • Manipulating CSS Styles with JavaScript
  • Event Listeners

Tools Used

  1. VS Code (You can use any other code editor)
  2. A modern web browser (Chrome, Firefox, Safari, or Edge).
  3. Access to an internet connection for resource imports.

Contributing

If you'd like to contribute to this challenge:

  1. Fork the repository on GitHub.
  2. Clone your forked repository to your local machine:
  3. git clone https://github.com/Yashi-Singh-1/Day-37-Change-Background-Color-On-Click.git
  4. Create a new branch for your feature or bug fix:
  5. git checkout -b feature-name
  6. Make your changes and commit them with a clear and concise message:
  7. git commit -m 'Add new feature or fix'
  8. Push your changes to your forked repository:
  9. git push origin feature-name
  10. Open a pull request to the main repository.
  11. Ensure your pull request includes a detailed description of your changes.
  12. Respond to any feedback or questions during the review process.

We welcome improvements, bug fixes, and additional features that can enhance this Change Background Color On-Click.