âš¡Voxel Black Friday Sale is now Live

Toggle Phone Number with Button

Description/Instructions

This code will allow you to create a button, and toggle the phone number with the click. Aside from the script below, be sure to add the class “phone-number” without quotes to your widget that has the class assigned to it. Action list widget does not allow a per action class yet so it will not work with an action widget with more than one action.

If this snippet helped, feel free to buy me a taco :)

Instructions

Add all of this to a single HTML widget

Show Phone Number

.phone-number {
display: none; /* Hide initially */
}

jQuery(document).ready(function($) {
$('.show-phone-btn').on('click', function() {
$('.phone-number').toggle(); // Toggle visibility of phone number
});
});

  • HTML
Copy Code

Let's Chat About this Snippet