-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfourth.html
77 lines (69 loc) · 2.4 KB
/
fourth.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
div{
display: inline-block;
margin: 10px;
justify-content: right;
}
img{
width: 500px;
}
body{
background-color: antiquewhite;
}
a {
background-color: red;
color: white;
padding: 1em 1.5em;
text-decoration: none;
text-transform: uppercase;
}
</style>
</head>
<body>
<a href="cart.html">Go To Cart</a>
<div>
<img src="https://ak1.ostkcdn.com/images/products/is/images/direct/fa22b4f0bb330169dab2acf6ce185d95319226a6/Metal-3-Tier-Low-Shelf.jpg" alt="">
<h3>Metal 3-Tier Low Shelf</h3>
<span style="font-size: large; color:yellow;">★★★★ </span>40
<h3>Starting atINR667755
</h3>
<select name="quantity" id="quantity">
<option value="1">Quantity : 1</option>
<option value="2">Quantity : 2</option>
<option value="3">Quantity : 3</option>
<option value="4">Quantity : 4</option>
<option value="5">Quantity : 5</option>
</select>
<button>Add To Cart</button>
<p>ITEM# 40252876</p>
<button>Favorits</button>
<br>
<div>
<br>
<h3>Details</h3>
<p>
70s inspired shelving unit brings function and style to any space;<br> Thoughtfully designed with sturdy steel construction and adjustable feet,<br> it's the perfect modern shoe rack alternative, stylish storage solution, or simply a blank canvas for displaying decorative accents and tokens from travel<br>
</p>
</div>
</div>
</body>
</html>
<script>
document.querySelector("button").addEventListener("click", first);
var obj = JSON.parse(localStorage.getItem("object")) || {};
function first(){
event.preventDefault();
var quantitiy = document.getElementById("quantity").value;
// var product = {"second": quantitiy}
obj.fourth = quantitiy;
console.log(obj, quantitiy)
localStorage.setItem("object", JSON.stringify(obj));
}
</script>