Optional
attributes?: IDictionary<string | number, string>Optional
classInstead use attributes.class
Optional
defaulttag for wrapping and apply styles
Optional
element?: keyof HTMLElementTagNameMapequal CSSRule (e.g. strong === font-weight: 700)
Apply some css rules for all selections. It method wraps selections in nodeName tag.
const editor = Jodit.make('#editor');
editor.value = 'test';
editor.execCommand('selectall');
editor.s.commitStyle({
style: {color: 'red'}
}) // will wrap `text` in `span` and add style `color:red`
editor.s.commitStyle({
style: {color: 'red'}
}) // will remove `color:red` from `span`
Checks if the cursor is at the end(start) block
true - the cursor is at the end(start) block, null - cursor somewhere outside
true - check whether the cursor is at the start block
Find in this
Node for cursor position
Wrapper for cursorInTheEdge
Optional
fake: null | NodeWrapper for cursorInTheEdge
Optional
fake: null | NodeInserts in the current cursor position some HTML snippet
parent.s.insertHTML('<img src="image.png"/>');
HTML The text to be inserted into the document
Insert image in editor
URL for image, or HTMLImageElement
If specified, it will be applied $(image).css(styles)
Insert element in editor
After insert, cursor will move after element
After insert, editor fire change event. You can prevent this behavior
Create marker element
Optional
range: RangeSaves selections using marker invisible elements in the DOM.
Do not change current range
Select node
select all inside
Split selection on two parts: left and right
Optional
edge: NodeWrap all selected fragments inside Tag or apply some callback
Wrap all selected fragments inside Tag or apply some callback
Check if editor has selection markers
Return current selected HTML
const editor = Jodit.make();
console.log(editor.s.html); // html
console.log(Jodit.modules.Helpers.stripTags(editor.s.html)); // plain text
Checks if the selected text is currently inside the editor
Check if editor has selection markers
Readonly
joditIf you like Jodit - try Jodit PRO
Apply some css rules for all selections. It method wraps selections in nodeName tag.
Example
Deprecated