New Froala Editor v5.3.0 is here – Learn More
Froala Documentation
- Installation Guides
- Browser Support
- Languages Support
- Shortcuts
- Activation
- Examples
- Customize the Editor
- Use-cases
- Plugins
- APIs
- Development Frameworks
- Server Integrations
- Server SDKs
- Migration Guides
- Changelog
- Tutorials
Word Counter in Froala Editor
Word Counter
Using the word_counter.min.jsplugin 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
Whats on this page hide