Detect Click-to-Call Support in JavaScript



The tel: protocol is supported by almost every mobile device nowadays. This includes Safari on iOS, Android Browser, Symbian browser, Opera Mini, etc.

Add it like this −

if (/(HTC825)/i.test(navigator.userAgent)){
   $("a[href^='tel:']").each(function(){
      this.href = this.href.replace("tel:", "wtai://wp/mc;");
   });
}
Updated on: 2020-06-25T07:19:05+05:30

215 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements