Skip to content

Commit aca35a7

Browse files
committed
Completed bonus missions LaunchCodeEducation#2 and LaunchCodeEducation#3
1 parent 264a4cd commit aca35a7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

index.html

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<body>
1010
<script src="script.js"></script>
1111
<h1>Astronauts</h1>
12+
<h2 id="astroCount">Total Number of Astronauts: </h2>
1213
<div id="container">
1314
<!-- List of astronauts will be added here dynamically -->
1415
</div>

script.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@ window.addEventListener("load", event => {
1818
</div>
1919
<img class="avatar" src="${json[i].picture}">
2020
</div>`
21-
22-
}
21+
}
2322

23+
const actives = document.querySelectorAll("li");
24+
for (bits of actives) {
25+
if (bits.innerText === "Active: true") {
26+
bits.setAttribute("style", "color: green");
27+
};
28+
};
29+
30+
document.getElementById("astroCount").innerText += json.length;
2431
})
2532
})
2633
})

0 commit comments

Comments
 (0)