title: Storing img src in a javascript variable
body: <p>When I click on an image, I want to store that particular images <code>src</code> in a Javascript variable. How can I do this? Keep in mind the <code>&lt;a&gt;</code> tag is there for the hover effect. So when I click on the <code>&lt;a&gt;</code> I want the image source of its sibling.</p>
  
  <p>Demo: <a href="http://jsfiddle.net/FVrTg/2" rel="nofollow">http://jsfiddle.net/FVrTg/2</a></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div&gt;
      &lt;img src = "http://upload.wikimedia.org/wikipedia/commons/thumb/2/26/YellowLabradorLooking_new.jpg/260px-YellowLabradorLooking_new.jpg"/&gt;
      &lt;a href = "#"&gt;&lt;/a&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
      &lt;img src = "http://whatiscat.com/wp-content/uploads/2011/07/cute_cat_2.whatiscat.com_.jpg"/&gt;
      &lt;a href = "#"&gt;&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>​</p>