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.