-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
37 lines (31 loc) · 872 Bytes
/
test.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
let inputMoney = document.getElementById('inputMoney')
let typeOfInputMoney = document.getElementById("inputTypeOfMoney")
let typeOfOutputMoney = document.getElementById("outputTypeOfMoney")
let outputMoney = ''
let vnd = ''
function converseMoney() {
switch(Number(typeOfInputMoney.value)) {
case 1 :
vnd = Number(inputMoney.value)*20000
break;
case 2 :
vnd = Number(inputMoney.value)*200
break;
case 3 :
vnd = Number(inputMoney.value)
break;
}
switch(Number(typeOfOutputMoney.value)) {
case 1 :
outputMoney = vnd/20000
break;
case 2 :
outputMoney = vnd/200
break;
case 3 :
outputMoney = vnd
break;
}
document.getElementById('outputMoney').textContent= "Output: " + outputMoney
}
//console.log('output money : ' + outputMoney)