title: jQuery: Add a title attribute to an element and insert text from following element
body: <p>I'm not even sure if this is possible but let's have a go.</p>
  
  <p>I have this HTML being dynamically generated for each image:</p>
  
  <pre><code>&lt;a href="image.jpg" class="thickbox"&gt;
      &lt;img src="thumb.jpg" title="This is the title" alt="" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>Somehow I need to take the title attribute from thumb.jpg and copy it to the surrounding anchor, which would give this result:</p>
  
  <pre><code>&lt;a href="image.jpg" class="thickbox" title="This is the title" alt=""&gt;
      &lt;img src="thumb.jpg" title="This is the title" alt="" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I'd be happy if this could be achieved with jQuery.</p>
  
  <p>Thanks in advance.</p>