title: On element click get img src attribute value
body: <p>I have the following html </p>
  
  <pre><code>&lt;td class="emailModal" data-name="My name" data-id="myId" data-target="#myModal" data-toggle="modal"&gt;
    &lt;div class="someClass"&gt;
      &lt;img class="imgClass" width="50%" align="left" src="/Content/images/myImage.png"&gt;
    &lt;/div&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>On the onclick event I'm fetching the <code>data-name</code> attribute value using js</p>
  
  <pre><code>var name = $(this).data('name');
  </code></pre>
  
  <p>My question is how to fetch the clicked image's <code>src</code> value using js</p>
  
  <p>Among the things I've tried:</p>
  
  <pre><code>var src = $(this).closest('img').attr('src');
  </code></pre>