API

Insert HTML Button

Try it yourself:


Edit in JSFiddle

HTML

<div id="froala-editor"></div>

JAVASCRIPT

<script>
  $(function() {
    FroalaEditor.DefineIcon('insertHTML', { NAME: 'plus', SVG_KEY: 'add' });
    FroalaEditor.RegisterCommand('insertHTML', {
      title: 'Insert HTML',
      focus: true,
      undo: true,
      refreshAfterCallback: true,
      callback: function () {
        this.html.insert('Some Custom HTML.');
        this.undo.saveStep();
      }
    });

    new FroalaEditor('div#froala-editor', {
      toolbarButtons: [
        ['bold', 'italic', 'underline', 'paragraphFormat', 'formatOL', 'formatUL'],
        ['insertHTML', 'undo', 'redo', 'html']
      ]
    })
  });
</script>