CodePen

HTML

            
              <a href="javascript:void(0);" id="link">a link</a>
<br><br><br>
<button onclick="javascript:$('#link').trigger('click');">Trigger Event</button>

<div id="text"></div>
            
          
!

CSS

            
              body {
  font-size: 20px;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              // DETECTING WHERE ON A LINK WAS CLICKED

$('a').on('click', function (e) {
  
  var
    $t    = $(this),
    os    = $t.offset(),
    x1    = os.left,
    x2    = x1 + $t.width(),
    y1    = os.top
  ;
  
  console.log(e.clientX);
  
  if (typeof(e.clientX) == 'undefined') {
    $('#text').text('Fake click detected');
  } else {
    $('#text').text('Please do not press this button again');
  }
  
});
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................