Skip to content

Commit 0443be6

Browse files
committed
abort mission
1 parent c320d43 commit 0443be6

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

dom-and-events/exercises/script.js

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

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

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

dom-and-events/exercises/style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
h1 {
22
text-decoration: underline;
3+
font-size: 100px;
34
}
5+
6+
p {
7+
font-size: 90px;
8+
}
9+
10+
button {
11+
font-size: 80px;
12+
}

0 commit comments

Comments
 (0)