File tree Expand file tree Collapse file tree 4 files changed +35
-13
lines changed Expand file tree Collapse file tree 4 files changed +35
-13
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "liveServer.settings.port" : 5502
2
+ "liveServer.settings.port" : 5502 ,
3
+ "githubPullRequests.ignoredPullRequestBranches" : [
4
+ " main"
5
+ ]
3
6
}
Original file line number Diff line number Diff line change 7
7
< title > Loan Calculatortitle >
8
8
< link rel ="stylesheet " href ="style.css ">
9
9
head >
10
- < body >
10
+ < body style ="font-family: 'Times New Roman', Times, serif; ">
11
+ < form action ="" id ="from ">
11
12
< div class ="container ">
12
13
< h1 > Loan Calculatorh1 >
13
14
< p > Loan Amount $
14
- < input onchange =" calculateLoan() " class ="input " type ="number " id ="loan-amount " min ="1 " max ="500000 " value ="10000 ">
15
+ < input class ="input " type ="number " id ="loan-amount " min ="1 " max ="500000 " value ="10000 ">
15
16
p >
16
17
< p > Interest Rate %
17
- < input onchange =" calculateLoan() " class ="input " type ="number " id ="interest-rate " min ="0 " max ="100 " value ="10 " step =".1 ">
18
+ < input class ="input " type ="number " id ="interest-rate " min ="0 " max ="100 " value ="10 " step =".1 ">
18
19
p >
19
20
< p > Months to pay
20
- < input onchange =" calculateLoan() " class ="input " type ="number " id ="months-to-pay " min ="6 " max ="48 " value ="12 ">
21
+ < input class ="input " type ="number " id ="months-to-pay " min ="6 " max ="48 " value ="12 ">
21
22
p >
22
- < p class ="payment " id ="payment "> Monthly Payment:p >
23
+ < button id ="c " class ="Cen " onclick ="calculateLoan() " style ="font-size: 15px; border-radius: 5px;height: 30px;text-align: center; "> Calculatebutton >
24
+ < br >
25
+ < br >
26
+
27
+ < div id ="payment "> div >
23
28
div >
29
+ form >
24
30
25
31
< script src ="index.js "> script >
26
32
body >
Original file line number Diff line number Diff line change 1
1
function calculateLoan ( ) {
2
- loanAmountValue = document . getElementById ( "loan-amount" ) . value ;
2
+ event . preventDefault ( ) ;
3
3
4
- interestRateValue = document . getElementById ( "interest-rate " ) . value ;
4
+ var loanAmountValue = document . getElementById ( "loan-amount " ) . value ;
5
5
6
- MonthsToPayValue = document . getElementById ( "months-to-pay " ) . value ;
6
+ var interestRateValue = document . getElementById ( "interest-rate " ) . value ;
7
7
8
- interest = ( loanAmountValue * ( interestRateValue * 0.01 ) ) / MonthsToPayValue ;
8
+ var MonthsToPayValue = document . getElementById ( "months-to-pay" ) . value ;
9
+
10
+ var interest = ( loanAmountValue * ( interestRateValue * 0.01 ) ) / MonthsToPayValue ;
9
11
10
12
monthlyPayment = ( loanAmountValue / MonthsToPayValue + interest ) . toFixed ( 2 ) ;
11
13
12
- document . getElementById (
13
- "payment"
14
- ) . innerHTML = `Monthly Payment: ${ monthlyPayment } ` ;
14
+
15
+ document . getElementById ( "payment" ) . innerHTML = "Total Loan to be paid is Ruppees " + monthlyPayment
16
+ document . getElementById ( "loan-amount" ) . value = "" ;
17
+ document . getElementById ( "interest-rate" ) . value = "" ;
18
+ document . getElementById ( "months-to-pay" ) . value = "" ;
19
+
20
+
15
21
}
Original file line number Diff line number Diff line change 6
6
justify-content : center;
7
7
align-items : center;
8
8
font-family : 'Courier New' , Courier, monospace;
9
+ background-color : rgb (246 , 150 , 82 );
9
10
}
10
11
11
12
.container {
24
25
.payment {
25
26
font-weight : 600 ;
26
27
font-size : 20px ;
28
+ }
29
+ .Cen {
30
+ text-align : center;
31
+ justify-content : center;
32
+ align-items : center;
33
+ margin-left : 80px ;
27
34
}
You can’t perform that action at this time.
0 commit comments