> This page is for Designer API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# Set Alt Text

> Set the Alt Text for an Image element on the canvas.

## `element.setAltText(altText)`

Set the Alt Text for an Image element on the canvas.

## Syntax

```typescript
element.setAltText(altText: string | null): Promise<null>
```

## Parameters

* **alt text**:  *string* - The alternate text for an image

## Returns

**Promise\<`null`>**

A Promise that resolves to `null`

## Example

```typescript
// Get Selected Element
const el = await webflow.getSelectedElement()

// Check element type
if (el?.type === 'Image') {
  // Set alt text
  await el.setAltText('Descriptive alternative text for this image')

  // Verify by getting the alt text
  const alt = await el.getAltText()
  console.log(alt)
} else {
  console.error('Please select an image element')
  await webflow.notify({
    type: 'Error',
    message: 'Please select an Image Element',
  })
}
```

## Designer Ability

| Designer Ability      | Locale | Branch | Workflow | Sitemode |
| :-------------------- | :----- | :----- | :------- | :------- |
| canModifyImageElement | any    | main   | canvas   | any      |

```
```