Skip to content

Instantly share code, notes, and snippets.

<h2>JQuery Mortgage Calculator</h2>
<script type='text/javascript' src='http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js'></script>
<!--The following formula is used to calculate the fixed monthly payment (P) required to fully amortize a loan of L dollars over a term of n months at a monthly interest rate of c. [If the quoted rate is 6%, for example, c is .06/12 or .005]. P = L[c(1 + c)^n]/[(1 + c)^n - 1]-->
<h3>Mortgage Calculator Example<br /></h3>
<form>
<p><input id="mcPrice" class="mortgageField" name="mcPrice" type="text" /> Sale price ($)</p>
<p><input id="mcDown" class="mortgageField" name="mcDown" type="text" /> Down payment (%)</p>
<p><input id="mcRate" class="mortgageField" name="mcRate" type="text" /> Interest Rate (%)</p>