-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path05-cart-quantity.html
More file actions
37 lines (33 loc) · 892 Bytes
/
05-cart-quantity.html
File metadata and controls
37 lines (33 loc) · 892 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
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
<title>Cart Quantity</title>
</head>
<body>
<button onclick="
console.log(`cart Quantity: ${cartQuantity}`);
">Show Quantity</button>
<button onclick="
//console.log(`cart Quantity: ${cartQuantity}`);
cartQuantity =+ 1;
">Add to cart</button>
<button onclick="
//cartQuantity = cartQuantity + 2;
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>
// no spacing in a varaible name
let cartQuantity = 0;
</script>
</body>
</html>