element.getTarget()

Get the target value of the link block element.

Syntax

1element.getTarget(): Promise<null | string | Page | AnyElement | Asset>;

Returns

Promise<null | string | Page | AnyElement | Asset>

A Promise that resolves to the target value of the link. The target value can be a string, Page, Element, or an Asset object.

Example

1const elements = await webflow.getAllElements() // Get All Elements
2const links = elements.filter((element) => element.type === 'Link') // Filter for Link elements
3
4// Print target value of each link element
5for (const link of links) {
6 const targetValue = await link.getTarget()
7 console.log(`ID: ${link.id.element}, Target Value: ${targetValue}`)
8}

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasanyanyanyany
Built with