forked from LaunchCodeEducation/DOM-and-Events-Studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
19 lines (15 loc) · 670 Bytes
/
scripts.js
File metadata and controls
19 lines (15 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Write your JavaScript code here.
// Remember to pay attention to page loading!
window.addEventListener('load',function() {
let myBtn = document.getElementById('takeoff');
myBtn.addEventListener('click',function() {
if (window.confirm("Confirm that the shuttle is ready for takeoff")) {
let myFlightStatus = document.getElementById('flightStatus');
myFlightStatus.innerText ="Shuttle In Flight";
let shuttleBg = document.getElementById('shuttleBackground');
shuttleBg.setAttribute('style','background-color: blue');
let shuttleHeight = document.getElementById('spaceShuttleHeight');
shuttleHeight.innerText = "10,000";
}
});
});