File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,4 +37,4 @@ <h3>Space Shuttle Height</h3>
3737 < button id = "missionAbort "> Abort Mission</ button >
3838 </ div >
3939 </ body >
40- </ html >
40+ </ html >
Original file line number Diff line number Diff line change 1- // Write your JavaScript code here.
2- // Remember to pay attention to page loading!
1+ function gitLit ( ) {
2+ const takeoff = document . getElementById ( "takeoff" ) ;
3+ const flightStatus = document . getElementById ( "flightStatus" ) ;
4+ const shuttleBackground = document . getElementById ( "shuttleBackground" ) ;
5+ const spaceShuttleHeight = document . getElementById ( "spaceShuttleHeight" ) ;
6+
7+ const land = document . getElementById ( "landing" ) ;
8+
9+ takeoff . addEventListener ( 'click' , event => {
10+ let response = window . confirm ( "Confirm that the shuttle is ready for takeoff." ) ;
11+
12+ if ( response ) {
13+ flightStatus . innerHTML = "Shuttle in flight." ;
14+ shuttleBackground . style . backgroundColor = "blue" ;
15+ spaceShuttleHeight . innerHTML = 10000 ;
16+ }
17+ } ) ;
18+
19+ land . addEventListener ( 'click' , event => {
20+ let response = window . confirm ( "The shuttle is landing. Landing gear engaged." ) ;
21+
22+ if ( response ) {
23+ flightStatus . innerHTML = "The shuttle has landed." ;
24+ }
25+ } )
26+
27+ }
28+ window . addEventListener ( "load" , gitLit ) ;
You can’t perform that action at this time.
0 commit comments