Skip to content

Instantly share code, notes, and snippets.

View slimeygecko's full-sized avatar

Mike Woodward slimeygecko

  • Minneapolis, MN
View GitHub Profile
// this assumes an existing html tag containing the upper limit
// of the word count, with an id of #word-count- + the id of the tinymce instance
// e.g. <p>Words left: <span id="word-count-textarea-1">200</span></p>
// add as a parameter to the tinyMCE.init({}); function
setup: function(ed) {
var text = '';
var span = document.getElementById('word-count-' + ed.id);
if(span) {
var wordlimit = span.innerHTML;