0% found this document useful (0 votes)
5 views2 pages

Java Compound

The document is an HTML code for an EMI (Equated Monthly Installment) Calculator. It includes input fields for loan amount, duration, and interest rate, along with buttons to submit or reset the values. The JavaScript functions calculate the EMI, monthly interest, and total interest based on user inputs.

Uploaded by

amit.ray455
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Java Compound

The document is an HTML code for an EMI (Equated Monthly Installment) Calculator. It includes input fields for loan amount, duration, and interest rate, along with buttons to submit or reset the values. The JavaScript functions calculate the EMI, monthly interest, and total interest based on user inputs.

Uploaded by

amit.ray455
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<!

DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EMI Calculator</title>
<style type="text/css">
#container{
width: 50%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
div {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
input[type=Submit] {
width: 100%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=text], select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type=Submit]:hover {
background-color: #45a049;
}
input[type=Reset]:hover {
background-color: #45a049;
}
</style>
</head>
<body style="text-align: center;">
<h1 style="background-color: cornflowerblue;">EMI Calculator</h1>
<div id="container">
<label>Enter Loan Amount</label>
<input type="text" id="first" placeholder="Input Loan Amount"></br>
<label>Enter Month Duration</label>
<input type="text" id="second" placeholder="Input Month"></br>
<label>Enter Rate of Interest</label>
<input type="text" id="rate" placeholder="Input Rate"></br>
<label>Monthly EMI</label>
<input type="text" id="emi" placeholder="EMI Rate" value="0" disabled></br>
<label>Paid Interest Per Month</label>
<input type="text" id="int" placeholder="Paid Interest" value="0"
disabled></br>
<label>Total Paid Interest</label>
<input type="text" id="total" placeholder="Total Paid Interest" value="0"
disabled></br>
<input type="button" value="Submit" onclick="emi()">
<input type="button" value="Reset" onclick="reset()">
</div>
<script type="text/javascript">
confirm("Enter OK to Continue");
function reset(){
document.getElementById("first").value="0";
document.getElementById("second").value="0";
document.getElementById("rate").value="0";
document.getElementById("emi").value="0";
document.getElementById("int").value="0";
document.getElementById("total").value="0";
}
function emi(){
confirm("Do You Want to See Your EMI? Enter OK ");
var a= Number(document.getElementById("first").value);
var m= Number(document.getElementById("second").value);
var r= Number(document.getElementById("rate").value);
var int=(a * (r * 0.01)) / m;
var emi=((a / m) + int).toFixed(2);
var total=int*m;
document.getElementById("emi").value=String(emi);
document.getElementById("int").value=String(int);
document.getElementById("total").value=String(total);
}
</script>
</body>
</html>

You might also like