Commit after each question.
-
Link to
script.js
inindex.html
-
View comments in
script.js
for the rest of this section's questions.
At minimum, you should be able to complete objectives 1-4, though you should be able to also complete 5 & 6 as well using what we have learned in class so far.
-
In
index.html
, link to a jQuery CDN. -
Link to
stoplight.js
inindex.html
-
Create an event listener(s) so that when you click on a light, it turns to its respective color (i.e., top light turns red). Examine
style.css
first and examine how the red light is being styled. -
If you click a light that is already on, it turns off.
-
If you click yellow, it switches to red after two seconds.
-
Make it so that only one light can be turned on at a time (e.g., both red and yellow cannot be on at the same time).