title: How to set image src using href from parent anchor?
body: <p>I have the following link which is supposed to show an image within the link when javascript is loaded:</p>
  
  <pre><code>&lt;a href="http://upload.wikimedia.org/wikipedia/commons/a/ae/Mad_scientist.svg" id="a"&gt;
   &lt;img alt="no image"&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>The javascript is supposed to get the href property of the link and include it when writing the html for the image.</p>
  
  <pre><code>$('#a').html('&lt;img src="' + $(this).attr('href') + '"&gt;image');
  </code></pre>
  
  <p>Somehow, <code>$(this).attr('href')</code> is returning <code>undefined</code>. What is wrong with this?</p>
  
  <p><strong><a href="http://jsfiddle.net/PvdMq/1/" rel="nofollow">JsFiddle</a></strong></p>