Custom button

You can create buttons two different ways.

  • Extend options.controls and after add button using string name
  • Add buttons like ControlType object

Include Jodit

<link rel="stylesheet" href="build/jodit.min.css">
<script src="build/jodit.min.js"></script>

Create input element

<textarea id="editor">Some text</textarea>

Extend controls store

Jodit.defaultOptions.controls.info = {
    iconURL: "./build/images/icons/269-info.png",
    popup: function (editor) {
        var text = editor.helper.trim(editor.editor.innerText);
        var wordCount = text.split(/[\s\n\r\t]+/).filter(function (value) {
            return value;
        }).length;
        var charCount = text.replace(/[\s\n\r\t]+/, '').length;

        return '<div style="padding: 10px;">' +
            'Words: ' + wordCount + '<br>' +
            'Chars: ' + charCount + '<br>' +
        '</div>';
    }
};

And use this button by name or create another button like ControlType

var editor = new Jodit('#editor', {
    buttons: [
        'image',
        {
            iconURL: './images/copy.png',
            exec: function (editor) {
                if (editor.selection.isCollapsed()) {
                    editor.execCommand('selectall');
                }
                editor.execCommand('copy');
                Jodit.Alert('Text in your clipboard');
            }
        }
    ],
    extraButtons: ["info"]
});

Result