Days
Hours
Minutes
Seconds
x

Froala Editor v4.2.0 is Here LEARN MORE

Skip to content

Buttons

External Button

Try it yourself:


Edit in JSFiddle

HTML

<div id="froala-editor">
  <p>This example illustrates how to clear the text using a button external to the Froala WYSIWYG HTML Editor interface.</p>
</div>
<p><a id="get-text" class="btn r-btn highlight text-small">Clear</a></p>

JAVASCRIPT

<script>
  new FroalaEditor('div#froala-editor', {
    events: {
      initialized: function () {
        var editor = this;
        editor.events.bindClick(editor.$('body'), 'a#get-text', function () {
          editor.html.set('');
          editor.events.focus();
        })
      }
    }
  });
</script>