File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 3
3
< head >
4
4
< title > Flight Simulator</ title >
5
5
< link rel ="stylesheet " type ="text/css " href ="style.css "/>
6
- < script src = "script.js "> </ script >
6
+ < script src = "C:\Users\tdube\Desktop\trylaunchcode\javascript-projects\dom-and-events\exercises\ script.js "> </ script >
7
7
</ head >
8
8
< body >
9
9
< h1 > Flight Simulator</ h1 >
Original file line number Diff line number Diff line change @@ -4,7 +4,22 @@ function init () {
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
+ missionAbort . addEventListener ( "mouseover" , event => {
11
+ event . target . style . backgroundColor = "red" ;
12
+ } ) ;
13
+ missionAbort . addEventListener ( "mouseout" , event => {
14
+ event . target . style . backgroundColor = "" ;
15
+ } ) ;
16
+ missionAbort . addEventListener ( 'click' , event => {
17
+ let abort = window . confirm ( "Are you sure you want to abort the mission?" ) ;
18
+ if ( abort ) {
19
+ paragraph . innerHTML = "Mission aborted! Space shuttle returning home" ;
20
+ }
21
+ } ) ;
22
+
8
23
}
9
24
10
25
window . addEventListener ( "load" , init ) ;
You can’t perform that action at this time.
0 commit comments