Practice listening for and handling JavaScript DOM Events
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# Stoplight Exercise
|
|
|
|
|
|
|
|
As always, fork and clone this repo. Submit a Pull Request when you are done.
|
|
|
|
|
|
|
|
## Stoplight
|
|
|
|
|
|
|
|
Wire up the buttons to the left of the stoplight to toggle the on/off state of each bulb.
|
|
|
|
|
|
|
|
![Screenshot of the stop bulb lit up](screenshot.png)
|
|
|
|
|
|
|
|
## Hints
|
|
|
|
|
|
|
|
* Retrieve a DOMElement with [`document.querySelector`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector)
|
|
|
|
* Attach listeners with [`addEventListener`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
|
|
|
|
* Set the color of a bulb with [`background-color`](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color)
|