title: In jQuery, how do I select elements between elements with certain classes?
body: <p>I have an unordered list.</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li class="foo"&gt;Baz&lt;/li&gt;
      &lt;li&gt;Select Me!&lt;/li&gt;
      &lt;li&gt;Select Me!&lt;/li&gt;
      &lt;li&gt;Select Me!&lt;/li&gt;
      &lt;li class="bar"&gt;Baz&lt;/li&gt;
      &lt;li&gt;Don't Select Me&lt;/li&gt;
      &lt;li&gt;Red Herring List Item&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>How do I select the list items in between the list items with classes foo and bar using jQuery? I do not know the contents of any list items. I also do not know how many list items are there to be selected so I cannot depend on a count.</p>