• Jodit
  • PRO
  • Builder
  • Getting Started
  • Playground
  • Examples
  • Documentation
  • Download
  • Overview
  • Issue tracker
  • Docs
  • Plugins
  • Demo
  • Pricing
  • File Browser Pro
  • Sign in
Get connected wth us on social networks!

Footer

Jodit Core

  • Jodit Home page
  • Documentation
  • Playground
  • Examples
  • Github
  • Issues

Integration

  • Jodit React
  • Jodit Angular
  • Jodit Vue
  • Jodit Yii2
  • Jodit Joomla

PRO/OEM plugins

  • AutoComplete
  • Backup Plugin
  • Button Generator
  • Change case
  • Custom Color Picker
  • Emoji
  • Finder
  • Google Search
  • Paste code
  • Show Blocks
  • Virtual Keyboard
  • Tune block
  • Highlight signature
  • Google Maps Editor
  • Export in PDF
  • Page Break
  • Iframe Editor
  • Paste from Word PRO
  • Mobile View
  • ToDo List
  • Translate

Links

  • Demo PRO/OEM
  • Demo FileBrowser PRO
  • Price
  • License
  • Support
  • For resellers

Versions

  • site v.0.1.810
  • Jodit PRO v.4.6.4
  • Jodit v.4.6.2
  • All versions
2025 © Copyright: XDSoft.net <support@xdsoft.net>
  • Getting started

    • Installation
    • Usage
    • Support
    • FAQs
    • Cloud
    • Examples
  • How to

    • Create plugin
    • Add custom button
    • Add custom font in the font list
    • How to create module
    • How to generate license key
    • How to make a backend finder
    • How to set up document view
  • Modes

    • Source mode
  • Customisation

    • Theme
    • Keyboard
  • API

    • License Rest API
    • JS API
  • Changelog

  • Plugins

    • AutoComplete
    • Backup Plugin
    • Button Generator
    • Change case
    • Custom Color Picker
    • Emoji
    • Finder
    • Google Search
    • Paste code
    • Show Blocks
    • Virtual Keyboard
    • Tune block
    • Highlight signature
    • Google Maps Editor
    • Export in PDF
    • Page Break
    • Iframe Editor
    • Paste from Word PRO
    • Mobile View
    • ToDo List
    • Translate

How to create module for Jodit Editor

You can write your own module for Jodit. For example create Dummy module, which will insert some code in editor Create file Dummy.js with this content

Jodit.modules.Dummy = function (editor) { this.insertDummyImage = function (w, h, textcolor, bgcolor) { const image = editor.createInside.element('img'); image.setAttribute( 'src', 'http://dummyimage.com/' + w + 'x' + h + '/' + (textcolor || '000') + '/' + (bgcolor || 'fff') ); editor.selection.insertNode(image); editor.setEditorValue(); // for syncronize value between source textarea and editor }; };
Copy

You need include this file after include jodit.min.js

<link type="text/css" rel="stylesheet" href="build/jodit.min.css" /> <script type="text/javascript" src="build/jodit.min.js"></script> <script type="text/javascript" src="Dummy.js"></script>
Copy

Now you can use this module. For example will append button in toolbar

Jodit.make('#editor', { buttons: [ 'bold', 'italic', { iconURL: 'images/dummy.png', tooltip: 'insert Dummy Image', exec: function (editor) { editor.dummy.insertDummyImage(100, 100, 'f00', '000'); } } ], events: { afterInit: function (editor) { editor.dummy = new Jodit.modules.Dummy(editor); } } });
Copy

Or you can use your mode like this:

var editor = new Jodit('#textareaid'); editor.getInstance('Dummy').insertDummyImage(100, 100, 'f00', '000');
Copy

That's all. You can try this example here