forked from arghadipmanna101/Flipkart_Clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
77 lines (66 loc) · 1.79 KB
/
index.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
let arr = [
{
img_src:
"https://rukminim1.flixcart.com/flap/80/80/image/29327f40e9c4d26b.png?q=100",
title: "Grocery",
},
{
img_src:
"https://rukminim1.flixcart.com/flap/80/80/image/22fddf3c7da4c4f4.png?q=100",
title: "Mobiles",
},
{
img_src:
"https://rukminim1.flixcart.com/fk-p-flap/128/128/image/0d75b34f7d8fbcb3.png?q=100",
title: "Fashion",
href:'Product.html'
},
,
{
img_src:
"https://rukminim1.flixcart.com/flap/80/80/image/69c6589653afdb9a.png?q=100",
title: "Electronics",
},
,
{
img_src:
"https://rukminim1.flixcart.com/flap/80/80/image/ab7e2b022a4587dd.jpg?q=100",
title: "Home and Furtinure",
},
{
img_src:
"https://rukminim1.flixcart.com/flap/80/80/image/0ff199d1bd27eb98.png?q=100",
title: "Appliances",
},
{
img_src:
"https://rukminim1.flixcart.com/flap/80/80/image/71050627a56b4693.png?q=100",
title: "Travel",
},
{
img_src:
"https://rukminim1.flixcart.com/flap/80/80/image/dff3f7adcf3a90c6.png?q=100",
title: "Beauty,Toys and More",
href: "",
},
{
img_src:
"https://rukminim1.flixcart.com/fk-p-flap/80/80/image/05d708653beff580.png?q=100",
title: "Two Wheelers",
href: "",
},
];
// let arr = [1,2,3,4,5];
// for(let i=0; i<arr.length;i++){
// console.log(arr[i]);
// }
arr.map((element)=>{
let image = document.createElement('img');
image.src = element.img_src;
let title = document.createElement("p");
title.innerHTML = element.title;
let box = document.createElement('div');
box.append(image,title);
document.getElementById("categories").append(box);
})
// let a = document.getElementById("categories");