I have the following list
<ul>
<li id="item1">Item 1</li>
<li id="item2">Item 2</li>
<li>Item 3</li>
<li id="item4">Item 4</li>
</ul>
Using jQuery, I'm trying to traverse the list of LIs whose IDs start with "item".
var nextItemWithItemID = $("#item2").next("li[id^='item']);
However, when I run this code, I end up retrieving "Item 3" rather than "Item 4".
How can I get jQuery to get the proper next item from a filtered list of LIs?