title: Jquery : Access data-link attribute
body: <p>i want to get data-link attribute form an image click . </p>
  
  <p>Following is my image tag </p>
  
  <pre><code>&lt;a href="#"  class="aclick"&gt;
      &lt;img data-link="petroliumjelly.php" src="productsimgs/petroliumjelly.png" class="img-responsive" id="2"&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>to get it on click this is what i am doing , </p>
  
  <pre><code>&lt;script type="text/javascript" language="javascript"&gt;
         $(".aclick").click(function (e) {
          e.preventDefault();
          alert($(this).attr("data-link"));
          var link = $(this).data("data-link");// tried both 
          console.log(link);
  
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>when i try to log or alert it, i get undefined 
  Please help me how can i fix it </p>