File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,24 @@ function init () {
3
3
const button = document . getElementById ( "liftoffButton" ) ;
4
4
const paragraph = document . getElementById ( "statusReport" ) ;
5
5
6
- // Put your code for the exercises here.
7
-
6
+ button . addEventListener ( 'click' , event => {
7
+ paragraph . innerHTML = 'Houston, we have liftoff!' ;
8
+ } ) ;
9
+
10
+ function abortFunc ( ) {
11
+ let abortMission = window . confirm ( "Are you sure you want to abort the mission?" ) ;
12
+ if ( abortMission ) {
13
+ paragraph . innerHTML = 'Mission aborted! Space shuttle returning home' ;
14
+ }
15
+ }
16
+ missionAbort . addEventListener ( 'click' , abortFunc ) ;
17
+
18
+ missionAbort . addEventListener ( "mouseover" , event => {
19
+ missionAbort . style . backgroundColor = "red" ;
20
+ } )
21
+ missionAbort . addEventListener ( "mouseout" , event => {
22
+ missionAbort . style . backgroundColor = "" ;
23
+ } )
8
24
}
9
25
10
26
window . addEventListener ( "load" , init ) ;
You can’t perform that action at this time.
0 commit comments