title: Add Number on Button Click using jQuery?
body: <p>I have a + and - button. I need to have them increase or decrease an input value based on the click. I have tried the following code: </p>
  
  <p><em><strong>HTML</em></strong></p>
  
  <pre><code>&lt;label for="CAT_Custom_410672"&gt;Veloce&lt;/label&gt;
  &lt;input type="text" class="cat_textbox" id="CAT_Custom_410672" name="CAT_Custom_410672" maxlength="4000" value="0" /&gt;
   &lt;ul class="button-group button-click"&gt;
    &lt;li&gt;&lt;a href="#" class="small button secondary"&gt;&lt;i class="fa fa-plus"&gt;&lt;span class="hide"&gt;+&lt;/span&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#" class="small button secondary"&gt;&lt;i class="fa fa-minus"&gt;&lt;span class="hide"&gt;-&lt;/span&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;
  </code></pre>
  
  <p><em><strong>JS</em></strong></p>
  
  <pre><code>$(function() {
  $(".button-click").on("click", function() {
  
    var $button = $(this);
    var oldValue = $button.parent().find("input").val();
  
    if ($button.text() == "+") {
        var newVal = parseFloat(oldValue) + 1;
      } else {
     // Don't allow decrementing below zero
      if (oldValue &gt; 0) {
        var newVal = parseFloat(oldValue) - 1;
      } else {
        newVal = 0;
      }
    }
  
    $button.parent().find("input").val(newVal);
  
  })
  });
  </code></pre>
  
  <p>How do I correct the script to function properly?</p>
  
  <p>Note: No errors are thrown. It just doesn't work.</p>