title: read element attribute in OnClick event
body: <p>I have A html element and would like to read data attribute in OnClick event</p>
  
  <pre><code>&lt;a id="downloadFile" class="btn btn-success" href="javascript:;" data="MyData"&gt;Download file&lt;/a&gt;
  </code></pre>
  
  <p>If I use code below this refer to href atribute and not to A element. How to refer to A element and read data value? </p>
  
  <pre><code> $('#downloadFile').click(function() {            
    alert(this.attr('data')); //I get error that 'href' do not has 'data' attribute, this code refers to href attribute and not to A element
  });
  </code></pre>