Skip to content

Commit f391d78

Browse files
June LeeJune Lee
authored andcommitted
completed step 4
1 parent 805fddb commit f391d78

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

dom-and-events/studio/scripts.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const shuttleBackground = document.getElementById("shuttleBackground");
55
const spaceShuttleHeight = document.getElementById("spaceShuttleHeight");
66

77
const land = document.getElementById("landing");
8+
const missionAbort = document.getElementById("missionAbort");
89

910
takeoff.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
}

0 commit comments

Comments
 (0)