-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path05-cart.html
More file actions
24 lines (23 loc) · 789 Bytes
/
05-cart.html
File metadata and controls
24 lines (23 loc) · 789 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
<!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+=2;
console.log(`Cart quantity: ${cartQuantity}`)">+2</button>
<button onclick="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>