Increment count on click of anchor
<p>I have the following code (found here) that works fine on it's own</p>

<pre><code>&lt;a id="inc"&gt;Good&lt;/a&gt;
&lt;a id="dec"&gt;Bad&lt;/a&gt;
&lt;input type="text" name="qty" value="0" readonly="readonly" /&gt;

&lt;script type="text/javascript"&gt;
  $(function(){
    $("#inc").click(function(){
      $(":text[name='qty']").val( Number($(":text[name='qty']").val()) + 1 );
    });
    $("#dec").click(function(){
      $(":text[name='qty']").val( Number($(":text[name='qty']").val()) - 1 );
    });
  });
&lt;/script&gt;
</code></pre>

<p>I'm having trouble finding the most efficient way to use this code in a case where you would have multiple instances of it on the same page. Obviously I would change the ID's to classes, but how do I make the anchors, when clicked only affect the text input nearest to it? Is the :next selector applicable here?
thx!</p>
