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