Skip to content

Commit e3df815

Browse files
committed
exer done
1 parent 80c280c commit e3df815

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

dom-and-events/exercises/script.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@ function init () {
44
const paragraph = document.getElementById("statusReport");
55

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

21+
});
22+
23+
24+
825
}
926

1027
window.addEventListener("load", init);

dom-and-events/exercises/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
h1 {
22
text-decoration: underline;
33
}
4+
5+
.abortMission {
6+
background-color: red;
7+
}

0 commit comments

Comments
 (0)