> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# `__SetAttribute`

## Introduction

Sets an attribute for a specific Element node.

## Syntax

```jsx
__SetAttribute(element: Element, key: string, value: any) : void;
```

### Parameters

|   Key   | Description                                           |
| :-----: | ----------------------------------------------------- |
| element | Any Element object.                                   |
|   key   | A string representing the attribute key to be set.    |
|  value  | Any value representing the attribute value to be set. |

### Return Value

No return value.

## Example

The frontend framework can generate render instructions as follows.

```jsx
<view src="xxx" />
```

```javascript
// main-thread.js
let element = __CreateElement('view', 0, {});
__SetAttribute(element, 'src', 'xx');
```
