-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05-cart-quantity.html
50 lines (41 loc) · 1011 Bytes
/
05-cart-quantity.html
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
<!DOCTYPE html>
<html>
<head>
<title> Cart Quantity</title>
</head>
<body>
<button onclick="
console.log(`Cart Quantity: ${cartQuantity}`)
">
Show Quantity
</button>
<button onclick="
cartQuantity = cartQuantity+1;
console.log(`Cart Quantity: ${cartQuantity}`)
">
Add to Cart
</button>
<button onclick="
cartQuantity = cartQuantity+ 2;
console.log(`Cart Quantity: ${cartQuantity}`)
">
+2
</button>
<button onclick="
cartQuantity = cartQuantity + 3;
console.log(`Cart Quantity: ${cartQuantity}`)
">
+3
</button>
<button onclick="
cartQuantity = 0;
console.log('Cart was reset.')
console.log(`Cart Quantity: ${cartQuantity}`)
">
Reset Cart
</button>
<script>
let cartQuantity = 0;
</script>
</body>
</html>