-1

In my markup, I have included a phone number that I want to be clickable. This is my code -

<h3 class="footer">Need help? Call <a href="tel:+180006XXXX">1800 06X XXX</a></h3>

When I run this code I see two red brackets around the phone number with a small chain like icon that says "invalid link". The number is not clickable.

Please help!

Archit Arora
  • 2,508
  • 7
  • 43
  • 69

1 Answers1

-1

That should be

<a href="tel://+180006XXXX">1800 06X XXX</a>

note the //...

Johannes
  • 64,305
  • 18
  • 73
  • 130
  • why the downvote? That's how phone links work. I am talking about a link that can be clicked on a *smartphone* to directly dial the number. Try it if you don't believe it! – Johannes Nov 22 '17 at 00:29
  • This actually worked. But I don't know why. @Johannes Could you please explain? – Archit Arora Nov 22 '17 at 00:30
  • just because that's the way a phone link is written... (compare to `http://...` for weblinks, where you also need these slashes) – Johannes Nov 22 '17 at 00:31
  • 1
    Are you really sure? According to 2.7.1 of [RFC 7230 on the `http` URI scheme](https://tools.ietf.org/html/rfc7230) the double forward slash is mandatory. The slashes are not mentioned by a single word in [RFC 3966 on the `tel` URI scheme](https://tools.ietf.org/html/rfc3966) – agrm Nov 22 '17 at 00:36
  • @Johannes wrong! `Phone: Let’s not forget that the primary purpose of a mobile phone is to call people! This can be smoothly integrated into your website by using the little known tel: protocol. Just like you use a mailto: to link to an email address, you use tel: to link to a phone number. When you click the tel: link it causes the phone to dial **Phone 5121234567 to book a table**` [w3c](https://www.w3.org/wiki/Introduction_to_mobile_web) – dippas Nov 22 '17 at 00:37
  • @agrm I haven't read either of these, but I have used it that way on websites where it works. – Johannes Nov 22 '17 at 00:37
  • @dippas maybe you should try it. And if the OP says it works now, it can't be that wrong, hm? – Johannes Nov 22 '17 at 00:39
  • @Johannes even more agmr said as well `tel:` protocol doesn't take`//` like `mailto:` doesn't too – dippas Nov 22 '17 at 00:41
  • @Johannes I wasn't aware `tel://` was even a thing. Out of curiosity, do you have any information on devices/browsers accepting `tel://` and not `tel:`? – agrm Nov 22 '17 at 00:47