Show or hide a text element when a button is clicked.
In this example, clicking the button toggles the visibility of the text. The button label also updates to indicate the current action.
We added the following to our site:
The code in this file shows or hides the message when the button is clicked:
If the text element is hidden, we show it, and then change the button’s label.
Otherwise, we hide the text element, and then change the button’s label.
Join the Wix Studio community on Discord, where experienced developers and fellow creators come together to share tips, troubleshoot issues, and collaborate.
Building a coded solution on your own can be challenging. Let an experienced Wix developer build it for you, so you can keep working on your site or business. Visit the Wix Marketplace to find a trusted developer.