title: How to disable the default behavior of an Anchor in jQuery Mobile (iOS)
body: <p>I am building an app for iPhone and iPad using PhoneGap and jQM</p>
  
  <pre><code>&lt;div class="ui-block-a"&gt;
     &lt;a id="btnLink" href="#pageID" data-role="button"&gt;&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and it functions fine, but when I run it on the device (didn't try the simulator) and press a long press, I get the default iPhone menu for a link in a normal browser to open or copy the link.</p>
  
  <p>how can I disable this default feature in my app?</p>
  
  <p>I tried these with no success:</p>
  
  <pre><code>$("a").click(function(event) {
    event.preventDefault(); // long press menu still apear
  });
  
  
  $("a").bind('click',function(event) {
  console.log(['preventingclick',event.type]);
  event.preventDefault(); // long press menu still apear
  });
  </code></pre>
  
  <p>if I bind on 'taphold' I still see the menu on a long press, but after I click cancel I see the console log: ["preventing long press","taphold"]</p>
  
  <pre><code>$("a").bind('taphold', function(event) {
  console.log(['preventing long press',event.type]);
  event.preventDefault(); // long press menu still apear
  });
  </code></pre>
  
  <p>if I use delegate on 'taphold' event like this: </p>
  
  <pre><code>$("a").delegate('taphold', function(event) {
  console.log(['preventing long press',event.type]);
  event.preventDefault();
  });
  </code></pre>
  
  <p>will fix the problem, but I can't attach any events anymore, so non of my buttons will work after that.</p>
  
  <pre><code>$('#btnLink').bind("click", function() {
  $.mobile.changePage('mypage', 'slide'); // won't fire any more because of the delegate before
  });
  </code></pre>
  
  <p>I know that delegate will apply on all elements now and in the future, but I think I am getting close to the answer, but not yet.</p>
  
  <p>Thanks in advance</p>
  
  <p><img src="https://i.stack.imgur.com/jqbMT.jpg" alt="Anchor long press menu on iPhone"></p>