So i have this program that i have to make for a final, its pretty easy, but im new at this. I just have to make a user enter money amount and then it displays the divided amount. I cant seem to get it to display in the text boxes.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
  <title>Correct Change</title>
  <script type="text/javascript">
  var coinChange = [
                ['1 dollar',100],
                ['25 cents',25],
                ['10 cents',10],
                ['5 cents',5],
                ['1 cents',1]
            ];
function init ()
{
  // reset form
  // set total and change to 0
  document.getElementById("txtDollars").value = 0;
  document.getElementById("txtQuarters").value = 0;
  document.getElementById("txtDimes").value = 0;
  document.getElementById("txtNickels").value = 0;
  document.getElementById("txtPennies").value = 0;
  // put values in textbox
  document.getElementById("txtDollars").disabled = true;
  document.getElementById("txtQuarters").disabled = true;
  document.getElementById("txtDimes").disabled = true;
  document.getElementById("txtNickels").disabled = true;
  document.getElementById("txtPennies").disabled = true;
}
function getCoins(){
                var amt = new Number(document.getElementById('txtAmount').value)*100;
                var str='', numCoins;
                for(i=0; i < coinChange.length; i++){
                    numCoins = Math.floor(amt / coinChange[i][1]);
                    str += coinChange[i][0] + ' = ' + numCoins+'<br />';
                    amt = Math.round(amt - (numCoins * coinChange[i][1]));
                }
				/*if (str = 100){
					document.frmChange.txtDollars.value = str;
				}
				else if (str = 25){
					document.frmChange.txtQuarters.value = str;
				}
				else if(str = 10){
					document.frmChange.txtDimes.value = str;
				}
				else if(str = 5){
					document.frmChange.txtNickels.value = str;
				}
				else if(str = 1){
					document.frmChange.txtPennies.value = str;
				}*/
                document.getElementById('results').innerHTML = str;
            }
           /*window.onload=function(){
               document.getElementById('btnGetCoins').onclick=getCoins;
			   }*/

  </script>  
</head>
    
  <b> Insert an amount from $0.01 to $5.00 
  <br />
  and it will give correct change
  </b>
  <br /></br>
  <b>
  Please Do not hit enter, Once Put the amount in the Text Box, just click out side the text box.</b><br/></br>
  
  <body>
    <form name="frmAmount">
        <input size=5 id="txtAmount" name="Amount" 
               onChange="getCoins ()"> Amount</br>
        <br />
		
    </form>

    <form name="frmChange">
        <INPUT type="text" id="txtDollars" name="Dollars" value=0 size=5> Dollars<br />
        <br />
        
        <INPUT type="text" id="txtQuarters" name="Quarters" value=0 size=5> Quarters<br />
        <br />
        
        <INPUT type="text" id="txtDimes" name="Dimes" value=0 size=5> Dimes<br />
        <br />
        
        <INPUT type="text" id="txtNickels" name="Nickels" value=0 size=5> Nickels<br />
        <br />
        
        <INPUT type="text" id="txtPennies" name="Pennies" value=0 size=5> Pennies<br />
        <br />
		<div id="results"></div>
    </form>    
	
    
<BODY onLoad="init()">
  </body>
</html>