I am a beginner to coding javascript. I have spent many hours trying to get this calculation result to display in the form box in the browser window. I think the calculation is correct because it works when I use a calculator but it doesn't do anything as it is now coded. Do I use parseInt, or Math.round and do I display it by saying return payment;

Any help would be greatly appreciated! Here's the code by cut and paste method:

<title>Final exam 2</TITLE>
/* car payment calculation function coding here */
function calc(myform) {
var interest = myform.rate.value / 100;
var total = ((myform.price.value - myform.down.value) * (1 + myform.rate.value));
var payment = myform.total.value / 60;{
return payment;

<body bgcolor="#FFE4E1">
<h1>Final Exam Car Payment Calculator(CPC)</h1>
</p><form name="myform" id="myform"><!--are the name and id required? I've seen examples of forms that are referenced in the script. The function is calling "myform" right?-->
<table border="1">
<td>Car Price:</td>
<td><input type="text" value="0" name="price" /></td>

<td>Interest rate:</td>
<td><input type="text" value="5.5" name="rate" /></td>
<td>Number of Years:</td>
<td>5 years (60 months)
<td>Down Payment:</td>
<td><input type="text" value="0" name="down" /></td>

<td>Monthly Payment:</td>
<td><input type="text" name="payment" onFocus="this.blur();" /></td><!--Why is this blur?-->
<input type="button" value="Calculate" onClick="return calc(this)" />
<input type="reset" value="Reset" />

<hr />
<h3>Question #2</h3>
Write a JavaScript function - calc() with parameter/argument to calculate a car payment:
<ul><li>interest = rate / 100</li>

<li>total = ((price - down) * (1 + interest))</li>
<li>payment = total / 60 </li>


Thanks, in advance!!