-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.js
29 lines (22 loc) · 912 Bytes
/
ui.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
class UI{
constructor(firstSelect, secondSelect){
this.firstSelect = firstSelect;
this.secondSelect = secondSelect;
// yazılı metinleri seçiyoruz
this.outputFirst = document.getElementById("outputFirst");
this.outputSecond = document.getElementById("outputSecond");
this.outputResult = document.getElementById("outputResult");
}
changeFirst(){
// first select in text contentini alıp yenisini atayacağız
this.outputFirst.textContent = this.firstSelect.options[this.firstSelect.selectedIndex].textContent;
}
changeSecond(){
// first select in text contentini alıp yenisini atayacağız
this.outputSecond.textContent = this.secondSelect.options[this.secondSelect.selectedIndex].textContent;
}
// sonuç kısmı
displayResults(result){
this.outputResult.value = result;
}
}