-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.js
50 lines (43 loc) · 1.34 KB
/
data.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
class RenderData {
constructor(death, confirmed, recovered) {
this.death = death;
this.confirmed = confirmed;
this.recovered = recovered;
}
renderAllDataProv() {
const dataCovidProv = document.querySelector('.statistikProvinsi');
dataCovidProv.innerHTML = '';
dataCovidProv.innerHTML +=
`<div class="cont death">
<h1 class="title">Meninggal</h1>
<h1>${this.death}</h1>
</div>
<div class="cont positive">
<h1 class="title">Terkonfirmasi</h1>
<h1>${this.confirmed}</h1>
</div>
<div class="cont recovered">
<h1 class="title">Sembuh</h1>
<h1>${this.recovered}</h1>
</div>
`;
}
renderAllDataNas() {
const dataCovidNas = document.querySelector('.statistikNasional');
dataCovidNas.innerHTML = '';
dataCovidNas.innerHTML += `
<div class="cont death">
<h1 class="title">Meninggal</h1>
<h1>${this.death}</h1>
</div>
<div class="cont positive">
<h1 class="title">Terkonfirmasi</h1>
<h1>${this.confirmed}</h1>
</div>
<div class="cont recovered">
<h1 class="title">Sembuh</h1>
<h1>${this.recovered}</h1>
</div>`;
}
}
export {RenderData};