年利息(%):
还款期(年):
首期付款:
计算每月付款:
$付款总额:
$总利息:
$CSS
#myTable {
margin: auto;
}
.output {
font-weight: bolder;
}
#payment {
text-decoration: underline;
}
#graph {
border: solid black 1px;
}
th td {
vertical-align: top;
}
button {
cursor: pointer;
}
JS
function calculate() {
// 贷款金额
let amount = document.getElementById(‘amount’);
// 年利息
let apr = document.getElementById(‘apr’);
// 还款期
let years = document.getElementById(‘years’);
// 首期付款
let firstPut = document.getElementById(‘firstPut’);
小编13年上海交大毕业&