title: Select part of text in a tag
body: <p>The DOM structure looks like this (existing website ... cant modify it):</p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;&lt;td&gt;
  &lt;br&gt;&lt;hr size="1"&gt;&lt;strong&gt;some heading 1&lt;/strong&gt;&lt;br&gt;
  &lt;br&gt;some text 1&lt;br&gt;
  
  &lt;br&gt;&lt;hr size="1"&gt;&lt;strong&gt;some heading 2&lt;/strong&gt;&lt;br&gt;
  &lt;br&gt;some text 2&lt;br&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I want to manipulate it so that it looks like this</p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;&lt;td&gt;
  &lt;br&gt;&lt;hr size="1"&gt;&lt;strong&gt;some heading 1&lt;/strong&gt;&lt;br&gt;
  &lt;br&gt;some text 1&lt;br&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;
  &lt;br&gt;&lt;hr size="1"&gt;&lt;strong&gt;some heading 2&lt;/strong&gt;&lt;br&gt;
  &lt;br&gt;some text 2&lt;br&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Using the solution posted <a href="https://stackoverflow.com/questions/481076/jquery-how-to-select-all-content-between-two-tags">here</a>, I am able to get hold of the hr, strong, br tags and move them into new td elements. However, I am not able to get hold of "some text 1" since it is directly contained within the td and using .text() on td will give me both "some text 1" as well as "some text 2".</p>
  
  <p>Any idea?</p>