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