title: How to change this javascript function to Jquery
body: <p>I have this code to work as character limiter for CKEditor, but its old and i dont know why does not work when i use Jquery librarie in the same web site</p>
  
  <pre><code>window.onload = function() {
          CKEDITOR.instances.aqui.on( 'key', function() {
              var str = CKEDITOR.instances.aqui.getData();
              var regex = /(&lt;([^&gt;]+)&gt;)/ig
              ,   result = str.replace(regex, "");
              if (result.length &gt; 50) {
                  CKEDITOR.instances.aqui.setData(str);
              }
          } );
      };
  </code></pre>
  
  <p>i want to update the code to use Jquery, but i dont know to much of jquery and i think if i use this function (replace, remove or text that) it will be more usefull</p>
  
  <p>The code works if you dont add the Jquery library.</p>