---
title: "Create"
---
# Create

Defined in: [src/core/create/create.ts:33](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L33)

## Implements

- [`ICreate`](../interfaces/types.ICreate.html)

### Constructor

**new Create**(`document`, `createAttributes?`): `Create`

Defined in: [src/core/create/create.ts:39](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L39)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `document` | [`Document`](https://developer.mozilla.org/docs/Web/API/Document) \| (() => [`Document`](https://developer.mozilla.org/docs/Web/API/Document)) |
| `createAttributes?` | [`CanUndef`](../modules/types.html#canundef)\<[`IDictionary`](../modules/types.html#idictionary)\<[`Attributes`](../modules/types.html#attributes) \| [`NodeFunction`](../modules/types.html#nodefunction)\>\> |

#### Returns

`Create`

### document

`readonly` **document**: [`Document`](https://developer.mozilla.org/docs/Web/API/Document) \| (() => [`Document`](https://developer.mozilla.org/docs/Web/API/Document))

Defined in: [src/core/create/create.ts:40](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L40)

***

### createAttributes?

`readonly` `optional` **createAttributes?**: [`CanUndef`](../modules/types.html#canundef)\<[`IDictionary`](../modules/types.html#idictionary)\<[`Attributes`](../modules/types.html#attributes) \| [`NodeFunction`](../modules/types.html#nodefunction)\>\>

Defined in: [src/core/create/create.ts:41](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L41)

#### Call Signature

**element**\<`K`\>(`tagName`, `children?`): `HTMLElementTagNameMap`\[`K`\]

Defined in: [src/core/create/create.ts:46](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L46)

##### Type Parameters

| Type Parameter |
| ------ |
| `K` *extends* keyof `HTMLElementTagNameMap` |

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `tagName` | `K` |
| `children?` | [`Children`](../modules/types.html#children) |

##### Returns

`HTMLElementTagNameMap`\[`K`\]

##### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`element`](../interfaces/types.ICreate.html#element)

#### Call Signature

**element**\<`K`\>(`tagName`, `attributes?`, `children?`): `HTMLElementTagNameMap`\[`K`\]

Defined in: [src/core/create/create.ts:50](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L50)

##### Type Parameters

| Type Parameter |
| ------ |
| `K` *extends* keyof `HTMLElementTagNameMap` |

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `tagName` | `K` |
| `attributes?` | [`Attributes`](../modules/types.html#attributes) |
| `children?` | [`Children`](../modules/types.html#children) |

##### Returns

`HTMLElementTagNameMap`\[`K`\]

##### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`element`](../interfaces/types.ICreate.html#element)

***

#### Call Signature

**div**(`className?`, `childrenOrAttributes?`): [`HTMLDivElement`](https://developer.mozilla.org/docs/Web/API/HTMLDivElement)

Defined in: [src/core/create/create.ts:81](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L81)

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `className?` | `string` |
| `childrenOrAttributes?` | [`Children`](../modules/types.html#children) |

##### Returns

[`HTMLDivElement`](https://developer.mozilla.org/docs/Web/API/HTMLDivElement)

##### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`div`](../interfaces/types.ICreate.html#div)

#### Call Signature

**div**(`className?`, `childrenOrAttributes?`, `children?`): [`HTMLDivElement`](https://developer.mozilla.org/docs/Web/API/HTMLDivElement)

Defined in: [src/core/create/create.ts:82](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L82)

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `className?` | `string` |
| `childrenOrAttributes?` | [`Attributes`](../modules/types.html#attributes) |
| `children?` | [`Children`](../modules/types.html#children) |

##### Returns

[`HTMLDivElement`](https://developer.mozilla.org/docs/Web/API/HTMLDivElement)

##### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`div`](../interfaces/types.ICreate.html#div)

***

### sandbox()

**sandbox**(): \[[`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement), [`HTMLIFrameElement`](https://developer.mozilla.org/docs/Web/API/HTMLIFrameElement)\]

Defined in: [src/core/create/create.ts:101](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L101)

#### Returns

\[[`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement), [`HTMLIFrameElement`](https://developer.mozilla.org/docs/Web/API/HTMLIFrameElement)\]

#### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`sandbox`](../interfaces/types.ICreate.html#sandbox)

***

#### Call Signature

**span**(`className?`, `childrenOrAttributes?`): [`HTMLSpanElement`](https://developer.mozilla.org/docs/Web/API/HTMLSpanElement)

Defined in: [src/core/create/create.ts:117](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L117)

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `className?` | `string` |
| `childrenOrAttributes?` | [`Children`](../modules/types.html#children) |

##### Returns

[`HTMLSpanElement`](https://developer.mozilla.org/docs/Web/API/HTMLSpanElement)

##### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`span`](../interfaces/types.ICreate.html#span)

#### Call Signature

**span**(`className?`, `childrenOrAttributes?`, `children?`): [`HTMLSpanElement`](https://developer.mozilla.org/docs/Web/API/HTMLSpanElement)

Defined in: [src/core/create/create.ts:118](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L118)

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `className?` | `string` |
| `childrenOrAttributes?` | [`Attributes`](../modules/types.html#attributes) |
| `children?` | [`Children`](../modules/types.html#children) |

##### Returns

[`HTMLSpanElement`](https://developer.mozilla.org/docs/Web/API/HTMLSpanElement)

##### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`span`](../interfaces/types.ICreate.html#span)

***

#### Call Signature

**a**(`className?`, `children?`): [`HTMLAnchorElement`](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement)

Defined in: [src/core/create/create.ts:141](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L141)

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `className?` | `string` |
| `children?` | [`Children`](../modules/types.html#children) |

##### Returns

[`HTMLAnchorElement`](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement)

##### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`a`](../interfaces/types.ICreate.html#a)

#### Call Signature

**a**(`className?`, `childrenOrAttributes?`, `children?`): [`HTMLAnchorElement`](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement)

Defined in: [src/core/create/create.ts:142](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L142)

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `className?` | `string` |
| `childrenOrAttributes?` | [`Attributes`](../modules/types.html#attributes) |
| `children?` | [`Children`](../modules/types.html#children) |

##### Returns

[`HTMLAnchorElement`](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement)

##### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`a`](../interfaces/types.ICreate.html#a)

***

### text()

**text**(`value`): [`Text`](https://developer.mozilla.org/docs/Web/API/Text)

Defined in: [src/core/create/create.ts:164](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L164)

Create text node

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `string` |

#### Returns

[`Text`](https://developer.mozilla.org/docs/Web/API/Text)

#### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`text`](../interfaces/types.ICreate.html#text)

***

### fake()

**fake**(): [`Text`](https://developer.mozilla.org/docs/Web/API/Text)

Defined in: [src/core/create/create.ts:171](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L171)

Create invisible text node

#### Returns

[`Text`](https://developer.mozilla.org/docs/Web/API/Text)

#### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`fake`](../interfaces/types.ICreate.html#fake)

***

### fragment()

**fragment**(): [`DocumentFragment`](https://developer.mozilla.org/docs/Web/API/DocumentFragment)

Defined in: [src/core/create/create.ts:178](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L178)

Create HTML Document fragment element

#### Returns

[`DocumentFragment`](https://developer.mozilla.org/docs/Web/API/DocumentFragment)

#### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`fragment`](../interfaces/types.ICreate.html#fragment)

***

### fromHTML()

**fromHTML**\<`T`\>(`html`, `refsToggleElement?`): `T`

Defined in: [src/core/create/create.ts:198](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L198)

Create a DOM element from HTML text

// eslint-disable-next-line tsdoc/syntax

#### Type Parameters

| Type Parameter |
| ------ |
| `T` *extends* [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) |

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `html` | `string` \| `number` | - |
| `refsToggleElement?` | [`IDictionary`](../modules/types.html#idictionary)\<`boolean` \| `void`\> | State dictionary in which you can set the visibility of some of the elements `const editor = Jodit.make('#editor'); editor.createInside.fromHTML(`<div> <input name="name" ref="name"/> <input name="email" ref="email"/> </div>`, { name: true, email: false });` |

#### Returns

`T`

#### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`fromHTML`](../interfaces/types.ICreate.html#fromhtml)

***

### applyCreateAttributes()

**applyCreateAttributes**(`elm`): `void`

Defined in: [src/core/create/create.ts:231](https://github.com/xdan/jodit/blob/main/src/core/create/create.ts#L231)

Apply to element `createAttributes` options

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `elm` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) |

#### Returns

`void`

#### Implementation of

[`ICreate`](../interfaces/types.ICreate.html).[`applyCreateAttributes`](../interfaces/types.ICreate.html#applycreateattributes)
