Skip to content

Commit ae20031

Browse files
committed
exercise completed
1 parent e902606 commit ae20031

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

dom-and-events/exercises/script.js

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

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

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

0 commit comments

Comments
 (0)