Sets or gets the target of the element's link.


An element's target determines where its link opens. The target can be set so the link opens in the current page or in a new page.

Supported values are:

  • "_blank": The link opens in a new tab or window.
  • "_self": The link opens in the tab or window.

Note: Link targets are only supported for external web links (e.g.


stringRead & Write, default value is "_blank"

Related Content:

Was this helpful?

Get the link target from an element

Copy Code
1let url = $w("#myElement").target; // "_blank"
Set the link target for an element

Copy Code
1$w("#myElement").target = "_blank";
Set an element to open an external web link in a new browser page when clicked

Copy Code
1$w("#myElement").link = "";
2$w("#myElement").target = "_blank";