File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const shuttleBackground = document.getElementById("shuttleBackground");
55const spaceShuttleHeight = document . getElementById ( "spaceShuttleHeight" ) ;
66
77const land = document . getElementById ( "landing" ) ;
8+ const missionAbort = document . getElementById ( "missionAbort" ) ;
89
910takeoff . addEventListener ( 'click' , event => {
1011 let response = window . confirm ( "Confirm that the shuttle is ready for takeoff." ) ;
@@ -24,6 +25,16 @@ land.addEventListener('click', event => {
2425 shuttleBackground . style . backgroundColor = "green" ;
2526 spaceShuttleHeight . innerHTML = 0 ;
2627 }
28+ } ) ;
29+
30+ missionAbort . addEventListener ( 'click' , event => {
31+ let response = window . confirm ( "Confirm that you want to abort the mission." ) ;
32+
33+ if ( response ) {
34+ flightStatus . innerHTML = "Mission aborted" ;
35+ shuttleBackground . style . backgroundColor = "red" ;
36+ spaceShuttleHeight . innerHTML = 0 ;
37+ }
2738} )
2839
2940}
You can’t perform that action at this time.
0 commit comments