title: Calculating unit price based on quantity entered
body: <p>I'm trying to create a script that displays a price in one box based on the number of employees entered in an adjacent box.
  The script works fine for a static amount, i.e. the base price is £8 per employee. If 5 is entered the price displayed is correct, £40.</p>
  
  <p>The problem I'm having is changing the unit price when a certain threshold is met. The unit price for 1-5 employees is 8, 6-21 is 7 and 22-50 is 6.
  No matter what is entered in the employee box, the number is always multiplied by 8.</p>
  
  <p>I'm very inexperienced when it comes to javascript so any help will be very welcome!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;div class="employee-button"&gt;
      &lt;form name="calculator" id="calculator"&gt;
      &lt;input name="employees" id="employees" type="text" placeholder="# of Employees" /&gt;
      &lt;/form&gt;
  &lt;/div&gt;  
  &lt;div class="cost-button"&gt;
      &lt;span id="result"&gt;Monthly Cost&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>$(function() {
  
      var ccNum;
      $('#employees').keyup(function(){
          ccNum = $(this).val();
      });
  
      if((ccNum &gt;= 0) &amp;&amp; (ccNum &lt;= 5)){
           var unitPrice = 8
      }
      else if((ccNum &gt;= 6) &amp;&amp; (ccNum &lt;= 21)){
           var unitPrice = 7
      }
      else if((ccNum &gt;= 21) &amp;&amp; (ccNum &lt;= 50)){
           var unitPrice = 6
      }
      else var unitPrice = 8;
  
      $('#employees').keyup(function(){
          $('#result').text(ccNum * unitPrice);
      });
  
  })
  </code></pre>