title: How do I merge two tags together in jQuery?
body: <p>That one is a tricky one I believe. I would like to <strong>merge</strong> two tags together. For exemple, those two <code>&lt;span&gt;</code> with different IDs are beside each others like this:</p>
  
  <pre><code>Lorem ipsum &lt;span id="selected-1"&gt;dolor sit&lt;/span&gt;&lt;span id="selected-2" title="important info here"&gt; amet, consectetur&lt;/span&gt; adipiscing elit.
  </code></pre>
  
  <p>At the end, I would like to merge <code>selected-1</code> and <code>selected-2</code> and <strong>keeping the attributes</strong> of <code>selected-2</code> to finally comes with something like:</p>
  
  <pre><code>Lorem ipsum &lt;span id="selected-2" title="important info here"&gt;dolor sit amet, consectetur&lt;/span&gt; adipiscing elit.
  </code></pre>
  
  <p>Any tips? I really can't figure out this one.</p>
  
  <p>Thanks.</p>