0

I have this html:

<div class="awpcp-subtitle">Contact Information</div>
<a href="https://adsler.co.uk/wp-user-test-dashboard- 
2/awpcp-reply-to-ad/13/madame-bovary/">Contact 
Anonymous</a>
<div class="phone"><label>Phone:</label> 
7576XXXXXX</div>
<div class="location"><label>Location:</label> London, 
UK</div>

</div>

Price: £ 3.00

<div class="fixfloat"></div>

I want to take the div class.phone, and make it into a button which links to mobile dialing screen.

Html and CSS options are welcome. The thing is, where do I insert the link in the html order, is it a href link, what's it's generic url?

Each number is different, according to the person who posted the ad, and number is only visible to logged in users. Therefore, '7576XXXXXX' is just an example of one of the numbers, in a logged out view. So how do I configure this with html? Because if I use:

</label>7576XXXXXX

... and this links to dialing screen, the phone will be literally trying to dial '7576XXXXXX,' and this for every ad. Each ad will also display 7576XXXXXX as its contact number, when each ad has a different contact number.

  • 1
    Possible duplicate of [How to trigger a phone call when clicking a link in a web page on mobile phone](https://stackoverflow.com/questions/1608548/how-to-trigger-a-phone-call-when-clicking-a-link-in-a-web-page-on-mobile-phone) – Madhawa Priyashantha Feb 23 '19 at 15:25
  • Please __add__ all context and sources related to your question __directly in your question__ via [edit]. So it's easier to answer than first read all your comments. – hc_dev Feb 23 '19 at 16:40

4 Answers4

1

Most browser support it and works fine for me

<div class="phone"><label><a href="tel:999-999-9999">Phone:999-999-9999</a></label></div>
Thomas_krk
  • 214
  • 1
  • 8
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackoverflow.com/rooms/188928/discussion-on-answer-by-thomas-krk-how-do-i-create-href-for-mobile-dialing-scree). – Bhargav Rao Feb 23 '19 at 17:12
0

With HTML 5 you can wrap an A Tag around a div so:

<a href="http://www.yourlink.com">
<div class="phone"><label>Phone:</label> 
7576XXXXXX</div>
</a>

Is that you meant, maybe not.

ultrarun
  • 274
  • 1
  • 13
  • You total pro. That's exactly what I mean. The question is, what's the link for mobile dialing screen so that, on pressing the button, your mobile will display the dialing screen with the number listed on its display, so all user has to do is press 'dial' button on dialing screen keypad? – user11074517 Feb 23 '19 at 15:38
  • It also has to be a generic link, and and generic number. Each number is different according to the number of the person who posted the ad. – user11074517 Feb 23 '19 at 15:43
0

Final version:

 <a href="tel:$adcontactphone"> <div class="phone">$adcontactphone</div> </a>
<a href="sms:$adcontactphone"> <div class="phone">$adcontactphone</div> </a>
Thomas_krk
  • 214
  • 1
  • 8
0

You can use a <a href="tel:99999999">Phone 999999</a> or put a function OnClick in your DOM, your function must have a window.open('tel:999999','_system')