79

Is it possible to make a phone number clickable in HTML so that when a user clicks on the number it is called?

4
  • Are you doing the HTML markup or are you trying to use a third party website and extract the phone numbers? Dec 31, 2010 at 21:09
  • @sugarynugs Doing HTML markup.
    – leeand00
    Jan 2, 2011 at 5:37
  • 1
    have you tried mbairds answer? that looks like what you want but whether it makes Android dial the number... Jan 2, 2011 at 13:03
  • Sorry to have been so dense. I didn't realize that your question was about generating the HTML, not about displaying it on the device. I'm going to delete my answer. Jan 4, 2011 at 19:32

2 Answers 2

163

Something like this should work:

<a href="tel:+1-800-555-5555">Call 1-800-555-5555</a>

More info:

http://en.wikipedia.org/wiki/URI_scheme#tel:

https://www.rfc-editor.org/rfc/rfc3966

2
  • 2
    Does this work on devices other than Android too? Such as BlackBerry and iPhone? (using each of their default browsers of course) And additionally what about on a browser like Opera Mini or Opera Mobile?
    – leeand00
    Jan 2, 2011 at 21:42
  • 3
    Yes, nothing about that is Android specific. I've tested it on iOS as well as Android.
    – Mark B
    Jan 2, 2011 at 23:16
0

You can detect a phone number in iOS with:

<i>web_view.dataDetectorTypes=UIDataDetectorTypePhoneNumber;<i>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.