Froala, Inc
- Getting Started
- Browser Support
- Languages Support
- Shortcuts
- Activation
- Examples
- Customize the Editor
- Use-cases
- Plugins
- APIs
- Development Frameworks
- Server Integrations
- Server SDKs
- Migration Guides
- Changelog
Miscellaneous
Word Counter
Using the word_counter.min.js
plugin it is possible to limit the number of words that can be introduced into the WYSIWYG HTML editor.
The maximum number of words can be changed using the wordCounterMax option.
Try it yourself:
HTML
<div id="editor">
<p> Write some words here.</p>
</div>
JAVASCRIPT
<script>
let editor = new FroalaEditor('#editor', {
pluginsEnabled: ['wordCounter'],
wordCounterCount: true,
wordCounterMax: 200,
events: {
"wordCounter.exceeded": function(){
console.log(this.wordCounter.wordCount());
},
"wordCounter.update": function(){
console.log(this);
},
}
});
</script>
Related Plugin:
Word Counter