-
Notifications
You must be signed in to change notification settings - Fork 1
/
dummyform.js
55 lines (48 loc) · 1.49 KB
/
dummyform.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
//Untuk dummy Input
//dummyInput();
function tampilRekomendasi(dicobaPengguna){
if(dicobaPengguna){
//Untuk Di coba pengguna
//menghapus segala div yang ada
hapusDiv();
//membuat segala div
buatDiv();}
printDataAsli();
}
function buatDiv(){
var divPrintHasil=document.createElement("DIV");
divPrintHasil.id="divPrintHasil";
var divTampilRekomendasi=document.createElement("DIV");
divTampilRekomendasi.id="matriksRekomendasi";
divTampilRekomendasi.appendChild(document.createElement("HR"));
var h2=document.createElement("H2");
h2.innerHTML="Hasil Rekomendasi";
var tabelDiv=document.createElement("TABLE");
tabelDiv.id="tabelRekomendasi";
tabelDiv.setAttribute("style","width:100%");
divTampilRekomendasi.appendChild(h2);
divTampilRekomendasi.appendChild(tabelDiv);
divPrintHasil.appendChild(divTampilRekomendasi);
document.getElementById("divFormBobot").appendChild(divPrintHasil);
}
function hapusDiv(){
document.getElementById("divPrintHasil").remove();
}
function dummyInput(){
prosesSlider1(6);
prosesSlider2(4);
prosesSlider3(0);
prosesSlider4(6);
prosesSlider5(2);
prosesSlider6(6);}
//logika remove DIV
Element.prototype.remove = function() {
this.parentElement.removeChild(this);
}
NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
for(var i = this.length - 1; i >= 0; i--) {
if(this[i] && this[i].parentElement) {
this[i].parentElement.removeChild(this[i]);
}
}
}