title: Character limitation for WordPress WYSIWYG editor
body: <p>I limited the number of characters that can be added as content for a special page (event submission page). It works fine in text or code mode in WordPress but not when I use the WYSIWYG editor.</p>
  
  <p><strong>Any idea how to change it so it also works using the WordPress editor?</strong></p>
  
  <p>Thank you so much!</p>
  
  <p>Here is the JS I am using.</p>
  
  <pre><code>     // Set your character limit
       var count_limit = 1000;
  
       // Set the initial symbol count on page load
       $('#tcepostcontent-wc span').html($('#tcepostcontent').val());
  
       $('#tcepostcontent').on('keyup', function () {
        var char_count = $(this).val().length;
        var tcepostcontent = $(this).val();
        var text_remaining = count_limit - char_count;
  
       // Update the character count on every key up
       $('#tcepostcontent-wc span').html(text_remaining);
  
       if (char_count &gt;= count_limit) {
         $('#tcepostcontent-wc').css('color', 'red');
         $(this).val(tcepostcontent.substr(1, count_limit));
       } else {
         $('#tcepostcontent-wc').css('color', null);
       }
  
       }).after('&lt;p id="tcepostcontent-wc"&gt;Max 1000 are available &lt;span&gt;1000&lt;/span&gt;&lt;/p&gt;');
  </code></pre>