asset.getAltText()
asset.getAltText()
This method retrieves the Alt Text for a specific Asset.
Syntax
asset.getAltText(): Promise<string>
Returns
Promise<string>
A Promise that resolves to the Alt Text string.
Example
// Get Asset by ID
const asset = await webflow.getAssetById(asset_id)
console.log(asset)
if (asset) {
// Get asset URL
const altText = await asset.getAltText()
console.log(`Asset Alt Text: ${altText}`)
}
Designer Ability
Checks for authorization only
Designer Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canAccessAssets | any | any | any | any |