-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
32 lines (30 loc) · 886 Bytes
/
script.js
File metadata and controls
32 lines (30 loc) · 886 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
32
async function load() {
let data = await fetch("data.json");
data = await data.json();
console.log(data);
let component = "";
data.forEach((teman) => {
component += ` <div class="main-container">
<div boox="boox-container">
<div class="card-container">
<article class="card-article">
<img src="${teman.fotoselfie}" class="card-img>
<div class="card-data">
<h2 class="card-title">About My Friend</h2>
<span class="card-description">
Nama : ${teman.nama} <br>
NIM : ${teman.nim} <br>
TTL : ${teman.ttl} <br>
Alamat: ${teman.alamat}<br>
No.Hp : ${teman.no}
</span>
<a href="#" class="card-button">Read More</a>
</div>
</article>
</div>
</div>
`;
});
document.getElementById("main").innerHTML = component;
}
load();