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