Currently, I am facing a challenge with my high school project of creating a timed traffic light sequence using JavaScript for my upcoming exams. Unfortunately, I feel quite lost and unsure about how to proceed. My initial plan involves formatting the values in my array (red, yellow, green) into distinct lights through CSS styling.
I've been attempting to code the red light as a practice exercise, but so far here is what I have:
<DOCTYPE html>
<html>
<body>
<script type = "JavaScript">
var myLights = ["red", "Yellow", "green"]
</script>
<script type = "CSS">
red {
border-radius: 50%;
width: 200px;
height: 200px;
color: #ff0000;
}
</script>
</body>
</html>
Not surprisingly, this code hasn't produced any visible results when viewed in Google Chrome.
If anyone out there could offer me some guidance or advice on how to improve my project, I would be extremely grateful.