Skip to content

Files

15 lines (12 loc) · 784 Bytes

002-color-palette-generator.md

File metadata and controls

15 lines (12 loc) · 784 Bytes

Color Palette Generator (DOM Navigation)

Objective

Create a grid of color squares that allows users to explore different color combinations by generating new palettes.

Description

  • The page displays a grid of squares, each representing a color in a palette.
  • Initially, each square is filled with a random color.
  • Users can generate a new palette by clicking a "Generate Palette" button.
  • Using DOM navigation, access and modify each square to change its color every time a new palette is generated.

Practical Skills

  • Use methods like querySelectorAll to select all palette squares.
  • Access and modify individual squares using childNodes or children.
  • Change the color of each square by iterating through the palette elements and updating them via the DOM.