JavaScript on HTML table of images
<p>I have a table in which each cell is an image in HTML. I need click functionality so that when you click on an image it takes you to a different HTML sheet linked to the image. I know I need to use JavaScript to do this but any kind of push in the right direction would be helpful. Each image cell in the table has it's own id as well.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table align="center" style="width:100%"&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;img src="http://images.genius.com/0bffd93463afe53e7f651f72bedfc78b.1000x1000x1.jpg" alt="The College Dropout" height="300" width="300" id="a1"&gt;&lt;/img&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;img src="https://images.genius.com/2eb75c8a4d53e8782d8e37681871a9bf.1000x1000x1.jpg" alt="Late Registration" height="300" width="300" id="a2"&gt;&lt;/img&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;img src="https://images.genius.com/336af3b66a79eb083a8469fa6f5c84c5.1000x1000x1.jpg" alt="Graduation" height="300" width="300" id="a3"&gt;&lt;/img&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;img src="https://images.genius.com/f69387025c516715db7b5d56037ee76a.1000x997x1.jpg" alt="808s_&amp;amp_Heartbreak" height="300" width="300" id="a4"&gt;&lt;/img&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;</code></pre>
</div>
</div>
</p>