Skip to content

Examples

Insert HTML Button

HTML

<div id="eg-insert-html" class="text-small"></div>

JAVASCRIPT

<script>
  $(function() {
    $('div#eg-insert-html').editable({
      inlineMode: false,

      buttons: [
        'bold', 'italic', 'underline', 'formatBlock', 'insertOrderedList',
        'insertUnorderedList', 'insertHTML', 'undo', 'redo', 'html'
      ],

      customButtons: {
        insertHTML: {
          title: 'Insert HTML',
          icon: {
            type: 'font',
            value: 'fa fa-plus'
          },
          callback: function () {
            // Insert HTML.
            this.insertHTML('Some custom HTML.');

            // Sync.
            this.sync();
          }
        }
      }
    })
  });
</script>