-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
77 lines (75 loc) · 1.33 KB
/
main.js
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
const products = [
{
img: 'img/boots.jpg',
title: 'Male Brown Boots',
price: '$15',
},
{
img: 'img/canvas.jpg',
title: 'White Canvas',
price: '$30',
},
{
img: 'img/binoculas.jpg',
title: 'Smart Binoculars',
price: '$100',
},
{
img: 'img/black-sneakers.jpg',
title: 'Black Sneakers',
price: '$23',
},
{
img: 'img/clothes.jpg',
title: 'Mix Clothes',
price: '$132',
},
{
img: 'img/headphones.jpg',
title: 'White Headphones',
price: '$76',
},
{
img: 'img/jeans.jpg',
title: 'Jeans',
price: '$22',
},
{
img: 'img/router.jpg',
title: 'Router',
price: '$43',
},
{
img: 'img/seven-zero.jpg',
title: 'Seven Zero T-shirt',
price: '$30',
},
{
img: 'img/sneakers.jpg',
title: 'Cool Sneakers',
price: '$37',
},
{
img: 'img/tablet.jpg',
title: 'Tablet',
price: '$100',
},
{
img: 'img/watch.jpg',
title: 'Smart Watch',
price: '$39',
},
];
const items = document.getElementById('product');
function data() {
products.forEach((product) => {
items.innerHTML += `<div class="product">
<img src="${product.img}" alt="" />
<div class="productDetails">
<h2>${product.title}</h2>
<h3>${product.price}</h3>
</div>
</div>`;
});
}
window.onload = data();