ChatGPT解决这个技术问题 Extra ChatGPT

Is there a way to make a phone number clickable on an iphone or android phone to make a call in HTML?

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

Are you doing the HTML markup or are you trying to use a third party website and extract the phone numbers?
@sugarynugs Doing HTML markup.
have you tried mbairds answer? that looks like what you want but whether it makes Android dial the number...
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.

C
Community

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


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?
Yes, nothing about that is Android specific. I've tested it on iOS as well as Android.
U
Undo

You can detect a phone number in iOS with:

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