title: jQuery if input text equals var do something
body: <p>I have a form that calculates the sum of several input values (checkboxes and dropdowns - not user entered values). At the bottom of the form I have a "Discount Code" box, I want to be able to enter a code and it takes a set amount off the total.</p>
  
  <p>With my code I am trying to say, if text entered = discount code, change the value of the input to 50. Here is what I have so far</p>
  
  <pre><code>var discountCode = 'DISTR50';
  var codeEntered = $("input[name='discount']");
  
   if (discountCode = codeEntered) {
      $('#discount input').attr('value',50);
   }
  </code></pre>
  
  <p>and for the html:</p>
  
  <pre><code>&lt;input type="text" id="discount" name="discount" class="txt"/&gt;
  </code></pre>