If I have a simple HTML list
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li id="some-id">Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
</ul>
it's easy to select every list item after #some-id
:
$("#some-id ~ li")
but how do I select the items before #some-id
?