Skip to content

Commit f18acf1

Browse files
Quinton KornegayQuinton Kornegay
Quinton Kornegay
authored and
Quinton Kornegay
committed
Aborted and headed home
1 parent 552f89a commit f18acf1

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

dom-and-events/exercises/script.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@ function init () {
33
const button = document.getElementById("liftoffButton");
44
const paragraph = document.getElementById("statusReport");
55

6-
// Put your code for the exercises here.
6+
button.addEventListener('click', event => {
7+
paragraph.innerHTML = 'Houston! We have liftoff!';
8+
});
9+
10+
missionAbort.addEventListener('mouseover', function (event) {
11+
event.target.style.backgroundColor = "red";
12+
});
13+
14+
missionAbort.addEventListener("mouseout", function (event) {
15+
event.target.style.backgroundColor = "";
16+
});
17+
18+
missionAbort.addEventListener('click', function (event) {
19+
window.confirm ("Are you sure you want to abort the mission?")
20+
if (window.confirm = true) {
21+
paragraph.innerHTML = "Mission aborted! Space shuttle returning home."
22+
};
23+
});
724

825
}
926

0 commit comments

Comments
 (0)