title: Why does this increment/decrement code work with jquery 1.3 and not with 1.6?
body: <p>This code allows me to change the value of a number box on a form using jquery. It works with 1.3 but not with 1.6. Can anyone explain why?</p>
  
  <pre><code>$(function() {
  
  $("form div").append('&lt;div class="inc button"&gt;+&lt;/div&gt;&lt;div class="dec button"&gt;-&lt;/div&gt;');
  
  $(".button").click(function() {
      var $button = $(this);
      var oldValue = $button.parent().find("input").val();
  
  if ($button.text() == "+") {
      var newVal = parseFloat(oldValue) + 1;
  } else {
  if (oldValue &gt;= 1) 
      {
          var newVal = parseFloat(oldValue) - 1;
      }
  }
      $button.parent().find("input").val(newVal);
  });
  });
  </code></pre>
  
  <p>Code is from the tutorial <a href="http://css-tricks.com/4011-number-increment-buttons/" rel="nofollow">here</a>.</p>