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

# `__SwapElement`

## Introduction

Swaps the positions of two Elements.

## Syntax

```jsx
__SwapElement(childA: Element, childB: Element) : void;
```

### Parameters

|   Key  | Description                       |
| :----: | --------------------------------- |
| childA | The first element to be swapped.  |
| childB | The second element to be swapped. |

### Return Value

No return value.

## Example

The frontend framework can perform replacement operations as follows.

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

let childB = __CreateElement('view', 0, {});

let parent = __CreateElement('view', 0, {});

__AppendElement(parent, childA);
__AppendElement(parent, childB);

__SwapElement(childA, childB);
```
