-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
53 lines (43 loc) · 1.55 KB
/
Copy pathindex.js
File metadata and controls
53 lines (43 loc) · 1.55 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// //document.getElementById("count").innerText = 5 //changes from 0 to 5
// //variable count and holds 0.
// let firstBatch = 5
// let secondBatch = 7
// let count = firstBatch + secondBatch
// //console is for debugging, checking ur code (like print)
// console.log(count)
// //create a variable, myAge and set its value to your age
// let myAge = 20
// //log the myAge variable to the console
// console.log(myAge)
// 1. Create two variables, myAge and humanDogRatio
// 2. Multiply the two together and store the result in myDogAge
// 3. Log myDogAge to the console
// let myAge = 20
// let humanDogRatio = 7
// let myDogAge = myAge * humanDogRatio
// console.log(myDogAge)
// Create a variable, bonusPoints. Initialize it as 50. Increase it to 100.
// Decrease it down to 25, and then finally increase it to 70
// intialize the count as 0
//listen for clicks on the increment button
//increment the count variable when the button is clicked
//change the count in the HTML to reflect the new count
let count = 0
let countEl = document.getElementById("count-el")
function increment(){
count += 1
countEl.innerText = count
}
let saveEl = document.getElementById("save-el")
// 1. Create a function, save(), which logs out the count when it's called
function save() {
let countDash = count + " - "
saveEl.textContent += countDash
countEl.textContent = 0
count = 0
}
// let welcomeEl = document.getElementById("welcome-el")
// let name = "Jisol"
// let greeting = "Hello "
// welcomeEl.innerText = greeting + name
//welcomeEl.innerText += "👋"