Jquery .next() function not working
<p>Guys i am trying to do something like this i have two href and a text box in the middle of those &lt;-> TEXT &lt;+> So when i press the - and + the value in the txt must increase or decrease by one</p>

<p>and i am using a jquery to + and - the value in the text box. Whenever i press + its happening correctly but for - it takes the TEXT fields name instead of its value . Any solution for this to make it to take the value of the TEXT box Jquery used follows :</p>

<pre><code>$(".quantity .subtract").click(function () {
    var qtyInput = $(this).next('input');
    var qty = parseInt(qtyInput.val());
    if (qty &gt; 1)
        qtyInput.val(qty - 1);

    qtyInput.focus();
    return false;
});

$(".quantity .add").click(function () {
    var qtyInput = $(this).prev('input');
    var qty = parseInt(qtyInput.val());
    if (qty &gt;= 0 &amp;&amp; (qty + 1 &lt;= 999))
        qtyInput.val(qty + 1);

    qtyInput.focus();
    return false;
});
</code></pre>

<p>And their Ids ll be different as more than one time i m using thm in the page</p>
