Hi, I was looking to make my page mobile responsive in terms of a “call us” feature that only works with mobile phones. I was told to Google it by a BoldGrid support staff on one of the support forums. I did, and planned to add my findings to the answers to my own question to help others (I am sure it is a common need)… However, it turns out the widget editor uses html only. How would I embed javascript into a widget? I have tried methods found online and have not been successful. Please help. I am looking to use the following script in a widget:
if (is_mobile_device()) {
<p class=”h3 alt-font”><i class=”fa fa-phone”></i> <a href=”tel:+27726238587″>Call today</a></p>;
} else {<p class=”h3 alt-font”>Call today<i class=”fa fa-phone”></i></p>;
}