Create an interaction between a Wix site page and a custom element.
In this code example, we create a custom HTML element that interacts with a site page. When you click the button on the site page, it sends a message to the custom element and updates its displayed text. Similarly, when you click the button on the custom element, it sends a message back to the site page.
Your site must have a Wix premium plan to use this feature.
We added the following to our site:
The code in this file demonstrates how to interact with the custom element. In this file, we:
ce-hello-world.js The code in this file defines a custom HTML element that includes methods for creating elements, handling events, and updating content based on user interactions.
In this file, we:
Join the Wix for Devs 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.