Hello World

Basic site that changes text when a button is clicked.

Introduction Last updated: 19 Mar 2025

About


In this example, we use an onClick handler on a button to change text.

APIs


How we built it


We added the following to our site:

Page Elements

Home

Frontend Code

Home
  • The code in this file changes the message when the button is clicked. In this file, we:
  1. Set the initial message.

2 Add an onClick event handler to the button that changes the message when triggered.

Code Snippets


Home
Copy
$w.onReady(function () { $w("#clickMeButton").onClick(() => { $w("#helloText").text = "Hello Wix!"; }); });

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?