Skip to content
Advertisement

Add tel: to phone number after calling it from database php

I’m using this to call phone number from database

JavaScript

and hiding it with this :

JavaScript

this is JavaScript i use to show and hide the phone number

JavaScript

what I want is to add <a href=”tel:phoneNumber so the phone number will be clickable one the article page

you can see the link here : https://www.lhawta.ma/classified/appartement-meuble-en-plein-centre-31f69.html

Advertisement

Answer

Try the following. Save the number to a Javascript variable, then assign it to your HTML element as follows:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement