[jQuery] Trouble with $#next() and ':not()' selector

[jQuery] Trouble with $#next() and ':not()' selector

<div>I have a simple list of items, and I am dynamically disabling them by adding a class name of "disabled" to the <li>. When I try to select the next non-disabled item using $#next(), I am getting 'null'. But if I use $#nextAll() and add ':eq(0)' to the selector, it works.</div>
<div>
</div><div>Here's is an example:</div><div>
</div><div>HTML:</div><div><div><ul id="theTest"></div><div><span class="Apple-tab-span" style="white-space:pre"> </span><li class="item">First</li></div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span><li class="item disabled">Second (Disabled)</li></div><div><span class="Apple-tab-span" style="white-space:pre"> </span><li class="item">Third</li></div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span><li class="item">Fourth</li></div><div></ul></div></div><div>
</div><div>JS:</div><div>$(document).ready(function()</div><div>
{</div><div>    // Get the first enabled LI element</div><div>    var first = $('#theTest li.item:not(.disabled):eq(0)');</div><div>    console.log('first item: ' + first.html()); // "First"</div>
<div>    </div><div>    // Get next enabled LI element</div><div><span class="Apple-style-span" style="color: rgb(153, 0, 0);"><span class="Apple-style-span" style="font-weight: bold;">    var next = first.next('li.item:not(.disabled)'); // does not work</span></span>
</div><div>    console.log('next item: ' + next.html()); // Should be "Third" but I get "null"</div><div>    </div><div><span class="Apple-style-span" style="color: rgb(0, 102, 0);"><span class="Apple-style-span" style="font-weight: bold;">    next = first.nextAll('li.item:not(.disabled):eq(0)'); // does work</span></span></div>
<div>    console.log('nextAll item: ' + next.html()); // Should be "Third" but I get "null"</div><div>});</div><div>
</div><div>It seems to me that $#next() gets the very next element, <span class="Apple-style-span" style="font-style: italic;">then</span> tries to match it to the selector. Is this the intended behavior?</div>
<br clear="all">-Hector