> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# createIframe

```ts theme={null}
function createIframe(target: string | HTMLElement): HTMLIFrameElement;
```

Creates an iframe element inside the target container.

## Parameters

| Parameter | Type                      | Description                                                                                                                                                                          |
| --------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `target`  | `string` \| `HTMLElement` | Either a CSS selector string or an HTMLElement container. If a string, will query for an element and create an iframe inside it. If an HTMLElement, will create an iframe inside it. |

## Returns

`HTMLIFrameElement`

The iframe element.

## Throws

InputValidationError if target is an iframe element, selector resolves to an iframe, or selector doesn't match any element.
