Dynamic CSS background-color switcher

34.0% Acceptance

In this lab, you will create a simple HTML page with a single button with id switchBtn and a div element with id colorBox. The objective is to implement a JavaScript function that generates a random color in HEX format when the button is clicked and applies it as the background color of the div element on the page.

Concepts covered in this lab are:

  • Basic HTML structure
  • CSS styling
  • JavaScript events
  • Generating random HEX colors
  • Manipulating DOM elements

To pass this lab, you must complete the challenges mentioned below: