# element.mount()

> Use this method to mount the Element instance to the specified DOM container. After calling element.mount(), the SDK will create an iframe within the container and load the corresponding WebApp page.

Use this method to mount the Element instance to the specified DOM container. After calling `element.mount()`, the SDK will create an iframe within the container and load the corresponding WebApp page.

## **Method signature**

When calling this method, please use the following standard method signature format.

#### Tab: JavaScript

```javascript
element.mount(container)
```

#### Tab: TypeScript

```typescript
element.mount(container: HTMLElement): void
```

## Parameters

| **Parameter** | **Data type** | **Required** | **Description** |
| --- | --- | --- | --- |
| _container_ | HTMLElement | Yes | DOM container node (e.g., `document.getElementById('container')`). |

## Return value

This method returns a Promise. You can use `element.mount().catch()` to capture exceptions during the mounting process.

## Error codes

Use the [`element.on()`](https://docs.antom.com/ac/sdks/web_element-on.md) method to listen for error codes related to the `element.mount()` method. For a detailed list of error codes, please refer to the [Error codes](https://docs.antom.com/ac/sdks/web_element-on.md#Wiybs).

## Best practices

-   Mounting timing: Mounting must be completed before calling [`antom.confirmCardSetup()`](https://docs.antom.com/ac/sdks/web_antom-confirmCardSetup.md) or [`antom.confirmPayment()`](https://docs.antom.com/ac/sdks/web_antom-confirmPayment.md).
-   Container requirements:

-   Ensure the container element already exists in the DOM when calling `element.mount()`.
-   It is recommended that the container width be no less than 375px, with no height restriction to allow the Element to expand automatically.

-   Repeated mounting: The same Element instance can only be mounted once. Calling `element.mount()` repeatedly will result in an exception. 
-   Unmounting: To remove an Element, call the [`element.unmount()`](https://docs.antom.com/ac/sdks/web_element-unmount.md) method.