File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 9
9
< body >
10
10
< script src ="script.js "> </ script >
11
11
< h1 > Astronauts</ h1 >
12
+ < h2 id ="astroCount "> Total Number of Astronauts: </ h2 >
12
13
< div id ="container ">
13
14
<!-- List of astronauts will be added here dynamically -->
14
15
</ div >
Original file line number Diff line number Diff line change @@ -18,9 +18,16 @@ window.addEventListener("load", event => {
18
18
</div>
19
19
<img class="avatar" src="${ json [ i ] . picture } ">
20
20
</div>`
21
-
22
- }
21
+ }
23
22
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 ;
24
31
} )
25
32
} )
26
33
} )
You can’t perform that action at this time.
0 commit comments