Skip to content

A simple JavaScript project that generates a random RGB color on each button click. The color is displayed as text and applied as the background of a div. A beginner-friendly DOM events, functions, and styling practice project.

Notifications You must be signed in to change notification settings

shanusingh01/random-color-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎨 Random Color Generator

This project generates a random RGB color every time the button is clicked. The color value appears in the heading, and the background of the display box updates instantly. It’s a simple and beginner-friendly project built to practice DOM events, functions, and style manipulation in JavaScript.


πŸš€ Features

  • Generates a random rgb(r,g,b) color.
  • Displays the generated color text.
  • Updates the background color of a box.
  • Uses JavaScript DOM events and functions.
  • Very beginner-friendly project.

πŸ“‚ Project Structure

  • index.html – Page layout
  • style.css – Minimal styling
  • app.js – Logic for generating and applying random colors

🎯 What I Learned

  • Working with addEventListener
  • Using functions in JavaScript
  • Manipulating DOM elements
  • Manipulating styles with JavaScript
  • Generating random values

πŸ§ͺ How to Use

  1. Click the Generate Color button
  2. A new random RGB color appears
  3. The background of the display box updates instantly

πŸ“„ License

Free to use for learning and practice.

About

A simple JavaScript project that generates a random RGB color on each button click. The color is displayed as text and applied as the background of a div. A beginner-friendly DOM events, functions, and styling practice project.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published