HTML iframe elements allow you to embed raw HTML or another website within your page.
In general, you don't have access to the HTML and full code of your site's pages. This can be limiting when you want to add 3rd-party code to your site. Using an HTML element you can sometimes overcome these limitations by embedding raw HTML to your page.
You can embed HTML iframe elements in the editor (Wix Studio and Wix Editor).
You can view and access any HTML iframe elements created in the editor when using other IDEs, such as the Local IDE. The IDEs synchronize with the editor to ensure consistency.
You can also add more detailed code using:
The HTML element creates a sandboxed environment (an iframe) that does not have direct access to the other elements on your page. This means that widgets or libraries that need access to the rest of your page will not work in an HTML element. You can, however, pass data between your page code and the code in an HTML element. so you can use it in all sorts of situations to do things you can't normally do directly. You can see a working example of an HTML element that passes data to and from the page in this HTML component example site.
To learn more about using HTML elements, see Embedding a Site or a Widget.
You can embed the following elements using an HTML element:
For an example of how to create a widget within an HTML iframe component, see Creating a Rich Text Editor Using the HTML Component.
There are many JavaScript libraries that you can use in an HTML element. The library you add will only be able to interact with the elements inside your HTML element. To interact with the library from your page code or to interact with your page elements from the library, you need to use the messaging model described in Messaging Between a Site Page and an HTML Element.
You can see a working example of a site that creates a chart using the Chart.js library in an HTML element in this Chart example.