solvit.io

Call to a phone number when the user clicks on a link

Solution

Add the phone number in the href attribute of the link and prefix it with tel:

<!-- ... -->
<body>
    <!-- ... -->
    <a href="tel:202-555-0115">Click here to call us</a>
</body>
<!-- ... -->

If you expect international visitors, include the international prefix:

<a href="tel:+1-202-555-0115">Click here to call us</a>

Read the RFC 3966 for the full details about the tel: URIs.

Find more solutions about: , ,