g-viet / til

Today I learned
6 stars 0 forks source link

Safari & webview in iOS: anchor tag is not responsed when clicking #2

Open g-viet opened 6 years ago

g-viet commented 6 years ago

It must have href attribute or put cursor:pointer; inside anchor tag being clicked:

<a class="clickable">I have no href => It does not work</a>
<a class="clickable" href="#">I have href => It works</a>
<a class="clickable cursor">I have cursor, no href => It works</a>

<style>
.cursor{
  cursor:pointer;
}
</style>

Ref:

  1. https://stackoverflow.com/questions/12207180/mobile-safari-and-jquery-events-nothing-is-firing

  2. https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW6