title: How to add links to images within HTML dynamically with JS?
body: <p>I have 50 divs like the below, and the image is not clickable. I would like to make the image clickable, depending on what link the div contains: it is always the href link in the article_title tag.</p>
  
  <p>How can I achieve this with adding just a few lines of JavaScript?</p>
  
  <p>I was thinking of adding an ID to each img tag manually, and then use getElementById and do some magic, but that would take too long.</p>
  
  <pre><code>&lt;div class="col-md-4 article"&gt;
        &lt;img src="7tips.jpg" alt="Canary Wharf" title="7 Tips For Lasting In Your Career" width="324" height="235"&gt; 
        &lt;div class="article_category"&gt;
           &lt;a href=”http://www.canarywharfian.co.uk/forums/wealth-management/”&gt;Wealth Management&lt;/a&gt; 
        &lt;/div&gt;
        &lt;div class="article_meta"&gt;
           &lt;h1 class="article_title"&gt;&lt;a href="http://www.canarywharfian.co.uk/threads/7-tips-for-lasting-in-your-career.242/" rel="bookmark" title="7 Tips For Lasting In Your Career"&gt;7 Tips For Lasting In Your Career&lt;/a&gt;&lt;/h1&gt;
           &lt;div class="col-md-6 author_date"&gt;&lt;a href="http://www.canarywharfian.co.uk/members/smallcappm.1140/"&gt;SmallCapPM&lt;/a&gt; - &lt;span class="date"&gt; Mar 10, 2016&lt;/span&gt;&lt;/div&gt;
           &lt;div class="article_abstract"&gt;
              Many of you are hoping and planning for a long and successful career in finance...
           &lt;/div&gt;
        &lt;/div&gt;
     &lt;/div&gt;
  </code></pre>