Notifications
Clear all
Topic starter 14/07/2021 9:52 pm
The following code on page load first updates the anchor href or link.
First, add an anchor tag on the webpage. And, then add the below script.
The below code will first update the anchor href value and on click (on android and iPhone devices), opens up the message box on phone.
jQuery(document).ready(function(){ if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { jQuery("#messageLink").attr("href", "sms:+10000000000&body=Hi, I have a question regarding your service. "); }else{ jQuery("#messageLink").attr("href", "sms:+10000000000?body=Hi, I have a question regarding your service. "); } });