JSFiddle - React, Tailwind, and code Playground

by lichangwei

HTML

<a id="alink" href="javascript: void 0;">A Link</a>
<input id="btn" type="button" value="Button">
<p>In iOS and Android device, a click event will be trigger on alink element if clicking the button.</p>

CSS

#btn{
  position: absolute;
  top: 0;
  left: 0;    
}

JavaScript

$('#btn').on('mouseup touchend', function(e){
    e.preventDefault();
    e.stopPropagation();
    $(this).hide();
});

$('#alink').on('click', function(e){
    alert('alink ' + e.type);
});