Hello Show and Hide Elements

Show or hide a text element when a button is clicked.

Introduction Last updated: 29 Jul 2025

About


In this example, clicking the button toggles the visibility of the text. The button label also updates to indicate the current action.

APIs


How we built it


We added the following to our site:

Page Elements

Home

Frontend Code

Home

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.

Code Snippets


Home
Copy

Get Help


Join the community

Join the Wix Studio community on Discord, where experienced developers and fellow creators come together to share tips, troubleshoot issues, and collaborate.

Hire a developer

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.

Did this help?