-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
48 lines (41 loc) · 1.57 KB
/
app.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
document.getElementById("d1").style.opacity="0"
document.getElementById("apply").addEventListener("click",()=>{
var amount=document.getElementById("amount").value
var rate=document.getElementById("rate").value
var sel1=document.getElementById("sel1").value
// document.getElementById("sel1").value;
document.getElementById("type").value=sel1
var sel2=document.getElementById("sel2").value
if (amount && rate && sel1 && sel2) {
document.getElementById("d1").style.opacity="1"
}
if(sel2 === "6"){
var ans=amount /6;
var ans1=amount * rate/100;
// var res=ans1
document.getElementById("monthpay").value=ans.toFixed(1)
document.getElementById("pa").value=" 6 Months"
document.getElementById("intpay").value=ans1.toFixed(1)
}
if(sel2 === "1"){
var ans=amount /12;
var ans1=amount * rate/100;
document.getElementById("monthpay").value=ans.toFixed(1)
document.getElementById("pa").value=" 1 Years"
document.getElementById("intpay").value=ans1.toFixed(1)
}
if(sel2 === "2"){
var ans=amount /24;
var ans1=amount * rate/100;
document.getElementById("monthpay").value=ans.toFixed(1)
document.getElementById("pa").value=" 2 Years"
document.getElementById("intpay").value=ans1.toFixed(1)
}
if(sel2 === "3"){
var ans=amount /24;
var ans1=amount * rate/100;
document.getElementById("monthpay").value=ans.toFixed(1)
document.getElementById("pa").value=" 3 Years"
document.getElementById("intpay").value=ans1.toFixed(1)
}
})