Image Element
The Image element represents an image in the Webflow Designer.
Properties
Methods
element.getAsset()
Retrieve an asset from an Image element.
Syntax
Returns
Promise<Asset> | null
A Promise that resolves to an Asset. If an element does not have an aseet, the method will return null
Example
Designer Ability
Checks for authorization only
element.setAsset()
Add an asset to an Image element.
Syntax
Parameters
- Asset: Asset - The asset to be inserted into the Image Element. Can be retrieved with the method
webflow.getAssetById
Returns
Promisenull
A Promise that resolves to null
Example
Designer Ability
Checks for authorization only
element.getAltText()
Retrieve the Alt Text for an Image element on the canvas. If the Image element does not have alt text, the API will retrieve the alt text from the associated Asset.
Syntax
Returns
Promise<String>
A Promise that resolves to an the string of Alt Text.
Example
Designer Ability
Checks for authorization only
element.setAltText()
Set the Alt Text for an Image element on the canvas.
Syntax
Parameters
altText: string - The Alternate Text for an image
Returns
Promisenull
A Promise that resolves to null
Example
Designer Ability
Checks for authorization only