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.
- 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.
- index.html β Page layout
- style.css β Minimal styling
- app.js β Logic for generating and applying random colors
- Working with
addEventListener - Using functions in JavaScript
- Manipulating DOM elements
- Manipulating styles with JavaScript
- Generating random values
- Click the Generate Color button
- A new random RGB color appears
- The background of the display box updates instantly
Free to use for learning and practice.