Search.../

src

Sets or gets the URL of the HTML Component's code.

Description

Setting the src property sets the website that is displayed in the HTML Component. The src value must be set to an HTTPS URL.

Getting the src property returns the URL of the website that is displayed in the HTML Component.

Note: The src property must be an HTTPS URL. Learn how to embed a site with an HTTP URL.

Type:

stringRead & Write

Was this helpful?

Get the displayed website's URL

Copy Code
1let compUrl = $w("#myHtmlComponent").src;
2// "https://comp.com/page.html"
Set the displayed website

Copy Code
1$w("#myHtmlComponent").src = "https://en.wikipedia.org/wiki/HTTPS";