# antom.createElement()

`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:<br/><br/>- _theme_: Theme color.<br/>- _variables_: Override underlying CSS custom properties using CSS design tokens (e.g., `color-primary`) to implement theme customization. |
| _locale_ | String | No | Multilingual configuration.<br/><br/>> **Note**:<br/>> - 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.<br/>> - If the parameter is omitted or contains an unsupported value, the system will default to English.<br/><br/>Valid values are:<br/><br/>- `en_US`: Default value. English<br/>- `pt_BR`: Portuguese (Brazil)<br/>- `pt_PT`: Portuguese<br/>- `es_ES`: Spanish<br/>- `ko_KR`: Korean<br/>- `zh_CN`: Simplified Chinese<br/>- `zh_HK`: Traditional Chinese<br/>- `ms_MY`: Malay<br/>- `in_ID`: Indonesian<br/>- `th_TH`: Thai<br/>- `vi_VN`: Vietnamese<br/>- `tl_PH`: Filipino<br/>- `it_IT`: Italian<br/>- `de_DE`: German<br/>- `fr_FR`: French<br/>- `nl_NL`: Dutch<br/>- `ja_JP`: Japanese<br/>- `ro`: Romanian<br/>- `pl_PL`: Polish<br/>- `ar_SA`: Arabic<br/>- `tr_TR`: Turkish<br/>- `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).