Create
create.Create
Implements
constructor
new Create(document, createAttributes?): Create
Parameters
| Name | Type |
|---|---|
document |
Document | () => Document |
createAttributes? |
CanUndef<IDictionary<Attributes | NodeFunction>> |
Returns
Defined in
document
Readonly document: Document | () => Document
Defined in
createAttributes
Optional Readonly createAttributes: CanUndef<IDictionary<Attributes | NodeFunction>>
Defined in
element
element<K>(tagName, children?): HTMLElementTagNameMap[K]
Type parameters
| Name | Type |
|---|---|
K |
extends keyof HTMLElementTagNameMap |
Parameters
| Name | Type |
|---|---|
tagName |
K |
children? |
string | Node | (string | Node)[] |
Returns
HTMLElementTagNameMap[K]
Implementation of
Defined in
element<K>(tagName, attributes?, children?): HTMLElementTagNameMap[K]
Type parameters
| Name | Type |
|---|---|
K |
extends keyof HTMLElementTagNameMap |
Parameters
| Name | Type |
|---|---|
tagName |
K |
attributes? |
Attributes |
children? |
string | Node | (string | Node)[] |
Returns
HTMLElementTagNameMap[K]
Implementation of
Defined in
div
div(className?, childrenOrAttributes?): HTMLDivElement
Parameters
| Name | Type |
|---|---|
className? |
string |
childrenOrAttributes? |
string | Node | (string | Node)[] |
Returns
Implementation of
Defined in
div(className?, childrenOrAttributes?, children?): HTMLDivElement
Parameters
| Name | Type |
|---|---|
className? |
string |
childrenOrAttributes? |
Attributes |
children? |
string | Node | (string | Node)[] |
Returns
Implementation of
Defined in
sandbox
sandbox(): [HTMLElement, HTMLIFrameElement]
Returns
[HTMLElement, HTMLIFrameElement]
Implementation of
Defined in
span
span(className?, childrenOrAttributes?): HTMLSpanElement
Parameters
| Name | Type |
|---|---|
className? |
string |
childrenOrAttributes? |
string | Node | (string | Node)[] |
Returns
Implementation of
Defined in
span(className?, childrenOrAttributes?, children?): HTMLSpanElement
Parameters
| Name | Type |
|---|---|
className? |
string |
childrenOrAttributes? |
Attributes |
children? |
string | Node | (string | Node)[] |
Returns
Implementation of
Defined in
a
a(className?, children?): HTMLAnchorElement
Parameters
| Name | Type |
|---|---|
className? |
string |
children? |
string | Node | (string | Node)[] |
Returns
Implementation of
Defined in
a(className?, childrenOrAttributes?, children?): HTMLAnchorElement
Parameters
| Name | Type |
|---|---|
className? |
string |
childrenOrAttributes? |
Attributes |
children? |
string | Node | (string | Node)[] |
Returns
Implementation of
Defined in
text
text(value): Text
Create text node
Parameters
| Name | Type |
|---|---|
value |
string |
Returns
Implementation of
Defined in
fake
fake(): Text
Create invisible text node
Returns
Implementation of
Defined in
fragment
fragment(): DocumentFragment
Create HTML Document fragment element
Returns
Implementation of
Defined in
fromHTML
fromHTML<T>(html, refsToggleElement?): T
Create a DOM element from HTML text
// eslint-disable-next-line tsdoc/syntax
Type parameters
| Name | Type |
|---|---|
T |
extends HTMLElement |
Parameters
| Name | Type | Description |
|---|---|---|
html |
string | number |
- |
refsToggleElement? |
IDictionary<boolean | void> |
State dictionary in which you can set the visibility of some of the elements js 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
Defined in
applyCreateAttributes
applyCreateAttributes(elm): void
Apply to element createAttributes options
Parameters
| Name | Type |
|---|---|
elm |
HTMLElement |
Returns
void
Implementation of
Defined in
jodit/src/core/create/create.ts:231