title: jQuery count characters and add class
body: <p>Is it possible to use jQuery to count how many characters are in, for example, an <code>&lt;li&gt;</code>, and if the amount is greater than XX characters, apply a class to that element?</p>
  
  <p>I've seen plenty of jQuery character counters (ie <a href="http://plugins.jquery.com/plugin-tags/character-counter" rel="nofollow">http://plugins.jquery.com/plugin-tags/character-counter</a>), and I can see how <code>.addClass()</code> would handle that part of things, but am having some trouble putting it together.</p>
  
  <p>Any pointers gratefully received.</p>
  
  <p>Many thanks</p>
  
  <p><strong>THANKS EVERYONE FOR THE ANSWERS - Found one solution that works for me as indicated below</strong></p>