I am using this anchor tag to make a call in android using cordova.
<a class="lft" href="tel:7767051447">Call</a>
Instead of number i want to give variable value.
I have number in
var phone_no
How do i pass variable instead of static number?
You could give the anchor an id:
<a class="lft" href="tel:7767051447" id="phone">Call</a>
and then update the href
attribute:
var phone_no = '12345';
document.getElementById('phone').href = 'tel:' + phone_no;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.