Answer the question
In order to leave comments, you need to log in
How to add href attribute for iOS?
I write the following code in jquery:
which works everywhere except for iPhones. I searched for this topic on the Internet, the problem is not only mine ( 1 , 2 , 3 ). The most interesting thing is that somewhere on jfiddle my code works on an iPhone, but it was me (in an iframe application) and only iPhones that made a goat's face.
From useful advice on the Internet, the recommendation to write data instead of attr or declare a reference in a variable and substitute it in the code did not bring success.
$('a[name=myName]').attr('href', '//myLink);
Answer the question
In order to leave comments, you need to log in
The point is that in html5 <a></a>
it cannot have a name attribute. Therefore, iphone and other devices may not be able to find it. This is even correct behavior.
Here:
https://www.w3schools.com/TAGs/tag_a.asp
It is
advised to use id instead of name for links
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question