Updating text node using jquery
<p>I have this html:</p>

<pre><code>&lt;span class="msg-container"&gt;
  &lt;span class="msg"&gt;&lt;/span&gt;
  A message here
&lt;/span&gt;
</code></pre>

<p>I'm wanting to use jQuery to find all the msg-container elements, take the "A message here" text and set the title attribute and remove the "A message here" text node.</p>

<p>So, after executing, my DOM should look like this:</p>

<pre><code>&lt;span class="msg-container" title="A message here"&gt;
  &lt;span class="msg"&gt;&lt;/span&gt;
&lt;/span&gt;
</code></pre>

<p>How do I achieve this?</p>
