-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcartQuantity.html
More file actions
37 lines (30 loc) · 878 Bytes
/
cartQuantity.html
File metadata and controls
37 lines (30 loc) · 878 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
35
36
37
<!DOCTYPE html>
<html>
<head>
<title>Cart Quantity</title>
</head>
<body>
<button onclick="
console.log(`Cart quantity: ${cartQuantity}`);
">Show Quantity</button>
<button onclick="
cartQuantity++;
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 quantity reset: ${cartQuantity}`);
">Reset cart</button>
<script>
let cartQuantity = 0;
</script>
</body>
</html>