Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

Random Color Generator (JavaScript)

A beginner-friendly JavaScript mini project that dynamically changes the background and text color of elements using random RGB values.

🚀 Features

  • Generates random colors using JavaScript
  • Applies colors to multiple elements
  • Uses DOM manipulation
  • Simple and clean logic

🛠️ Technologies Used

  • HTML
  • CSS
  • JavaScript

📸 How It Works

  • Selects all child elements inside a container
  • Generates random RGB values
  • Applies them as background and text color

🧠 Learning Outcomes

  • Understanding of DOM selection
  • Working with arrays and loops
  • Random number generation
  • Dynamic styling using JavaScript

▶️ How to Run

  1. Download or clone the repository
  2. Open index.html in your browser
  3. Refresh to see new random colors

📌 Example Code

functiongetRandomColor(){letval1=Math.ceil(Math.random()*255);letval2=Math.ceil(Math.random()*255);letval3=Math.ceil(Math.random()*255);return`rgb(${val1}, ${val2}, ${val3})`;}

About

Beginner-friendly project to understand DOM manipulation and random color generation in JavaScript.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages