Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger a phone call when clicking a link in a web page on mobile phone

I need to build a web page for mobile devices. There's only one thing I still haven't figured out: how can I trigger a phone call through the click of text?

Is there a special URL I could enter like the mailto: tag for emails?

Device specific solution are not preferred.

I know iPhone automatically recognizes phone numbers and creates a link for this, but it would be great if this could be done for images too... and also for most mobile devices.

like image 740
Frederic Morin Avatar asked Oct 22 '09 16:10

Frederic Morin


2 Answers

Most modern devices support the tel: scheme. So use <a href="tel:555-555-5555">555-555-5555</a> and you should be good to go.

If you want to use it for an image, the <a> tag can handle the <img/> placed in it just like other normal situations with : <a href="tel:555-555-5555"><img src="path/to/phone/icon.jpg" /></a>

like image 147
meme Avatar answered Oct 07 '22 15:10

meme


The proper URL scheme is tel:[number] so you would do

<a href="tel:5551234567"><img src="callme.jpg" /></a>
like image 43
Jess Avatar answered Oct 07 '22 15:10

Jess