title: Javascript Loop - Adding a var to the while condition?
body: <p>Basically I want to count and display the amount of months it would take to get to a certain point (savings balance) based on a contribution every month. </p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>function howLong(initial,interest,goal,added){
      var initialDeposit = parseInt(initial);
      var interestInt = parseInt(interest);
      var targetSaving = parseInt(goal);
      var contribution = parseInt(added);
      var monthCount = 0;
      while(initialDeposit &lt;= targetSaving){
          monthCount++;
          initialDeposit+contribution
      }
      alert(monthCount)
  }
  </code></pre>
  
  <p>Here is my html form:</p>
  
  <pre><code>&lt;form&gt;
  Initial Deposit:&lt;br /&gt;
  &lt;input type="number" id="initial"&gt;&lt;br /&gt;&lt;br /&gt;
  Interest:&lt;br /&gt;
  &lt;input type="number" id="interest"&gt;&lt;br /&gt;&lt;br /&gt;
  Target savings amount:&lt;br /&gt;
  &lt;input type="number" id="goal"&gt;&lt;br /&gt;&lt;br /&gt;
  Monthly Contribution:&lt;br /&gt;
  &lt;input type="number" id="contribution"&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;input type="button" value="How Long!?" onclick="howLong(document.getElementById('initial').value,document.getElementById('interest').value,document.getElementById('goal').value),document.getElementById('contribution').value"&gt;
  &lt;/form&gt;
  </code></pre>