How to trigger a phone call when clicking a link on a web page on a mobile phone with HTML?

Spread the love

Sometimes, we want to trigger a phone call when clicking a link on a web page on a mobile phone with HTML.

In this article, we’ll look at how to trigger a phone call when clicking a link on a web page on a mobile phone with HTML.

How to trigger a phone call when clicking a link on a web page on a mobile phone with HTML?

To trigger a phone call when clicking a link on a web page on a mobile phone with HTML, we set the href attribute of the a element to a phone number.

For instance, we write

<a href="tel:5551234567"><img src="callme.jpg" /></a>

to make a link that opens the phone dialer with phone number 5551234567 by setting the href attribute to tel:5551234567.

Conclusion

To trigger a phone call when clicking a link on a web page on a mobile phone with HTML, we set the href attribute of the a element to a phone number.

Leave a Reply

Your email address will not be published.