# antom.createElement()

> antom.createElement() is a factory method. After successfully calling  loadAntom()  to load the SDK and obtain the antom instance, you can use this method to dynamically create the corresponding payment or card binding element instance by passing in the specified elementType.

`antom.createElement()` is a factory method. After successfully calling  [`loadAntom()`](https://docs.antom.com/ac/sdks/web_loadAntom.md)  to load the SDK and obtain the `antom` instance, you can use this method to dynamically create the corresponding payment or card binding element instance by passing in the specified _elementType_.

## **Method signature**

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

#### Tab: JavaScript

```javascript
antom.createElement(elementType, options)
```

#### Tab: TypeScript

```typescript
antom.createElement(elementType: ElementType, options?: AppConfig): Element
```

## Parameters

This method accepts two parameters, which specify the type of element to be created and its configuration.

| **Parameter** | **Data type** | **Required** | **Description** |
| --- | --- | --- | --- |
| _elementType_ | String | Yes | Element type, valid values are: - `CVV`: Used to create the [`CVVElement`](https://docs.antom.com/ac/sdks/web_CVVElement.md) instance to collect the CVV (Card Verification Value) security code entered by the buyer. - `vaulting`: Used to create the [`VaultingElement`](https://docs.antom.com/ac/sdks/web_VaultingElement.md) instance to collect the buyer’ credit/debit card information to complete the card-binding process. |
| [_options_](#3twpC) | Object | No | A configuration object used to set the appearance theme and multilingual environment of components. |

### _options_

|**Parameter** |**Data type** |**Required** |**Description** |
| --- | --- | --- | --- |
| _appearance_ |Object |No |Used for custom appearance configuration. For more information, refer to [Appearance customization](https://docs.antom.com/ac/cashierpay/appearance.md). It contains the following parameters: -   _theme_: Theme color. -   _variables_: Override underlying CSS custom properties using CSS design tokens (e.g., `color-primary`) to implement theme customization.  |
| _locale_ | String | No | Multilingual configuration. > **Note**: -   If the _locale_ parameter is set in the [`loadAntom()`](https://docs.antom.com/ac/sdks/web_loadAntom.md) method, the _locale_ value in the `antom.createElement()` parameters takes precedence. -   If the parameter is omitted or contains an unsupported value, the system will default to English. Valid values are: -   `en_US`: Default value. English -   `pt_BR`: Portuguese (Brazil) -   `pt_PT`: Portuguese -   `es_ES`: Spanish -   `ko_KR`: Korean -   `zh_CN`: Simplified Chinese -   `zh_HK`: Traditional Chinese -   `ms_MY`: Malay -   `in_ID`: Indonesian -   `th_TH`: Thai -   `vi_VN`: Vietnamese -   `tl_PH`: Filipino -   `it_IT`: Italian -   `de_DE`: German -   `fr_FR`: French -   `nl_NL`: Dutch -   `ja_JP`: Japanese -   `ro`: Romanian -   `pl_PL`: Polish -   `ar_SA`: Arabic -   `tr_TR`: Turkish -   `hi_IN`: Hindi |

## Return value

This method returns an `element` instance object that provides methods for mounting, unmounting, destroying, and updating configurations, enabling flexible management of the component lifecycle on the page.

| **Function** | **Description** |
| --- | --- |
|[`element.on()`](https://docs.antom.com/ac/sdks/web_element-on.md) |Register event listeners for the Element instance. |
| [`element.mount()`](https://docs.antom.com/ac/sdks/web_element-mount.md) |Used to mount an element to a specified page node, and can be passed in a specific HTMLElement. |
| [`element.unmount()`](https://docs.antom.com/ac/sdks/web_element-unmount.md) | Unmount the current Element (can be remounted). |
| [`element.destroy()`](https://docs.antom.com/ac/sdks/web_element-destroy.md) | Destroy the current Element (cannot be remounted). |
| [`element.updateConfig()`](https://docs.antom.com/ac/sdks/web_element-updateConfig.md) |Update the configuration. |

## 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 `antom.createElement()` 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).