-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.js
More file actions
28 lines (19 loc) · 724 Bytes
/
app.js
File metadata and controls
28 lines (19 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
let body = document.body
let unit = prompt('Enter a unit of measure: inches, feet, meters, yards, kilometers, miles')
let number = prompt('Enter number to be converted')
console.log(unit);
console.log(number);
let values = {"feet": 0.3048,
"miles": 1609.34,
"meters": 1,
"kilometers": 1000,
"yards": 0.9144,
"inch:": 0.0254
}
let unitValue = values[unit];
let change = unitValue * number;
body.append(`Your input ${unit},
conversion: ${change} meters.`);
document.body.style.backgroundColor = "tan";
document.body.style.font = "italic bold 25px arial,serif";
document.getElementById("border").style.borderTop = "thick solid #0000FF";