title: How to select all content between two tags in jQuery
body: <p>I have a document with headings and unordered lists.</p>
  <p>How can I use JQuery to select a given heading (by its unique class name) AND all content between that heading and the next heading?</p>
  <h3>Update:</h3>
  <p>Your suggestions are great, but aren't what I'm looking for. In the below code, for example, I would like to access only the &quot;h1&quot; with id of &quot;heading2&quot; and everything up to, but not including the &quot;h1&quot; with id of &quot;heading3&quot;.</p>
  <p>The jQuery examples provided above will access everyting after the first &quot;h&quot; tag that is not an &quot;h&quot; tag.</p>
  <p>... or, correct me if I'm wrong :)</p>
  <pre><code>    &lt;h1 id=&quot;heading1&quot;&gt;...&lt;/h1&gt;
          &lt;ul&gt;...&lt;/ul&gt;
          &lt;p&gt;...&lt;/p&gt;
          &lt;ul&gt;...&lt;/ul&gt;
          &lt;p&gt;...&lt;/p&gt;
      &lt;h1 id=&quot;heading2&quot; &gt;...&lt;/h1&gt;
          &lt;ul&gt;...&lt;/ul&gt;
          &lt;p&gt;...&lt;/p&gt;
          &lt;ul&gt;...&lt;/ul&gt;
          &lt;p&gt;...&lt;/p&gt;
      &lt;h1 id=&quot;heading3&quot; &gt;...&lt;/h1&gt;
          &lt;ul&gt;...&lt;/ul&gt;
          &lt;p&gt;...&lt;/p&gt;
          &lt;ul&gt;...&lt;/ul&gt;
          &lt;p&gt;...&lt;/p&gt;
  </code></pre>