-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathranchi.js
56 lines (52 loc) · 1.46 KB
/
ranchi.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
let box1=async()=>
{
const url=`https://damp-garden-07205.herokuapp.com/api/placestoranchi`;
let res=await fetch(url);
let data=await res.json();
// console.log(data);
kuku1(data);
}
let kuku1=(data)=>
{
let container=document.getElementById("box1");
data.forEach(element => {
console.log(element);
let div=document.createElement("div");
let img=document.createElement("img");
img.src=element.image;
div.append(img);
container.append(div);
});
}
box1();
let box4=async()=>
{
const url=`https://damp-garden-07205.herokuapp.com/api/attractioninranchi`;
let res=await fetch(url);
let data=await res.json();
// console.log(data);
kuku4(data);
}
let kuku4=(data)=>
{
let container=document.getElementById("box4");
data.forEach(element => {
console.log(element);
let div=document.createElement("div");
let img=document.createElement("img");
img.src=element.image;
let name=document.createElement("h3");
name.innerText=element.name;
let place=document.createElement("p");
place.innerText=element.place;
let des=document.createElement("p");
des.innerText=element.des;
div.append(img,name,place,des);
container.append(div);
});
}
box4();
document.getElementById("btnseeall").addEventListener("click",btnseeall)
function btnseeall(){
window.location.href="ranchisell.html";
}