Search.../

target

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

Description

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. http://www.wix.com).

Type:

stringRead & Write, default value is "_blank"
Mixed in from:$w.LinkableMixin

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 = "http://wix.com";
2$w("#myElement").target = "_blank";