You can create Jodit only when you need.
HTML
<div class="editor" id="editor1">Some text</div>
<div class="editor" id="editor2">Some text</div>
<div class="editor" id="editor3">Some text</div>
<div class="editor" id="editor4">Some text</div>
<div class="editor" id="editor5">Some text</div>
<div class="editor" id="editor6">Some text</div>
JavaScript
var editors = [].slice.call(document.querySelectorAll('.editor'));
editors.forEach(function (div) {
div.addEventListener('click', function (e) {
if (!Jodit.instances[div.id]) {
Object.keys(Jodit.instances).forEach(function (id) {
Jodit.instances[id].destruct();
});
const editor = Jodit.make(div, {
preset: 'inline'
});
editor.s.insertCursorAtPoint(e.clientX, e.clientY);
}
});
});
Some text
Some text
Some text
Some text
Some text
Some text