android/iphone click to call in html

Just use tel: it will work on iOS, android, blackbarry OS, windows and many more. Using this scheme will work on almost all mobile browsers on.


You have to recognize the client. Since different phones have different user agents, you can do something like this with JavaScript:

if (navigator.userAgent.indexOf("Android") != -1) {
    txt = "<a href="tel:2125551212">2125551212</a>";
} else if (navigator.userAgent.indexOf("iPhone") != -1) {
    txt = "<a href="callto:2821229627-7877">Live Support</a>";
}