Is there any way by which I can count the characters entered in tinymce editor. I just want to set minimum character requirement. Or how to use tinyMCE.activeEditor.getContent()
properly for this purpose.
I believe that the better way to do this is using the getContent api:
// Get the HTML contents of the currently active editor
tinymce.activeEditor.getContent().length
// Get the raw text of the currently active editor
tinymce.activeEditor.getContent({format: 'text'}).length;
// Get content of a specific editor:
tinymce.get('content id').getContent().length
Please note the usage of the format
parameter in the second example in order to get the raw text instead of the parsed text with HTML tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With