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 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 >
Original file line number Diff line number Diff 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} )
You can’t perform that action at this time.
0 commit comments