Skip to content

Examples

Characters Counter

Using the char_counter.min.js plugin it is possible to limit the number of characters that can be introduced into the WYSIWYG HTML editor.

You can type only 140 characters.

HTML

<div id="eg-char-counter" class="text-small">
              <p>You can type only 140 characters.</p>
            </div>

JAVASCRIPT

<!-- Include the plugin file. -->
<script src="../js/plugins/char_counter.min.js"></script>
<script>
  $(function() {
    $('div#eg-char-counter').editable({
      // Set maximum number of characters.
      maxCharacters: 140,

      // Set basic mode.
      inlineMode: false
    })
  });
</script>