i have trouble displaying users' input and have spent some time looking at it and unsure which part had gone wrong. I am supposed to display the "Result" word in green and display user's input in a form of table. I used document.getElementsByClassName('container').innerHTML to add new element in the homepage. Could anyone explain why the word Result and table doesn't show?
My code:
/*** Home ***/
<!DOCTYPE html>
     
<html>
     <head>
          <!-- Required meta tags -->
          <meta charset="utf-8">
          <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      
          <!-- Bootstrap CSS -->
          <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
              integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
      
          <script src="mhsavings.js"></script>
     </head>
     <style>
        .main-content{
            width:70%;
            /* background-color: lightblue; */
            text-align: center;
        }
     </style>
     <body>
        <div class="container main-content">
            <h1 style="margin-top:40px;  margin-bottom: 30px;">Savings</h1>
            <h3 style="color:blue;margin-bottom:48px;">How long does it takes for me to reach My Goal?</h3>
            <form>
                <div class="input-group" style='margin-bottom: 16px;'>
                    <span class="input-group-text" id="basic-addon1">Initial Amount ($)</span>
                    <input type="text" class="form-control" placeholder="" aria-label="initial Amt" aria-describedby="basic-addon1" id="initialAmt">
                  </div>
                  
                  <div class="input-group" style='margin-bottom: 16px;'>
                    <span class="input-group-text" id="basic-addon2">Yearly interest (%)</span>
                    <input type="text" class="form-control" aria-label="yearly interest" aria-describedby="basic-addon2" id="yearlyInt">
                  </div>
                  
                  <div class="input-group" style='margin-bottom: 16px;'>
                    <span class="input-group-text" id="basic-addon3">My Goal</span>
                    <input type="text" class="form-control" id="goal" aria-describedby="basic-addon3" id="goal">
                  </div>
                  <button type="button" class="btn btn-danger" style="margin-top:30px"; id="calc" onclick="calculate()">Calculate</button>
                
            </form>
            
        </div>  
     </body>
</html>
/*** in JS file ***/
function calculate(){
    'use stict';
    var initialAmt = document.getElementById("initialAmt");
    var yearlyInt = document.getElementById("yearlyInt");
    var goal = document.getElementById("goal");
    console.log(goal.value);
    var receive = Math.round(initialAmt, 2);
    var years = 0;
    while (receive < goal) {
        receive *= (1 + yearlyInt);
        years += 1;
    }
    // console.log(document.getElementsByClassName('container'));
    document.getElementsByClassName('container').innerHTML = "<h3 style='color:green; margin-bottom: 20px'>Result</h3>";
    document.getElementsByClassName('container').innerHTML = `<table style='width: 500px'>
    <tr>
        <th>You will achieve your goal in (years):</th>
        <td>${years}</td>
    </tr>
    <tr>
        <th>You will get ($):</th>
        <td>${receive}</td>
    </tr>
    </table>`;
}
 
     
     
    