-
Notifications
You must be signed in to change notification settings - Fork 135
/
dogCalculator.js
38 lines (18 loc) · 1009 Bytes
/
dogCalculator.js
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
29
30
31
32
33
34
35
36
37
38
let input = document.querySelector(".input");
let clearButton = document.querySelector(".clear");
let equalsButton = document.querySelector(".equals");
let result = document.querySelector(".result");
// 1. Convert to an arrow function.
function calculateDoggieAge(humanAge) {
// 2. Declare a doggieAge variable and set it equal to the humanAge parameter multiplied by 7.
// 3. Update the result div's inner html to display the dog's age. Use string interpolation to create the message: "Your doggie is _________ years old in human years!"
}
equalsButton.addEventListener("click", () => {
// 4. Declare a userInput variable and set it equal to the value of the input. This needs to be a number, not a string! Be sure to place that inside our Number() method!
// 5. Call the calculateDoggieAge function. Be sure to include the userInput variable as the parameter!
})
// DO NOT TOUCH THIS CODE
clearButton.onclick = function() {
input.value = "";
result.innerHTML = "";
}