title: Javascript: Count visible characters in div
body: <p>I have a <code>div</code> which contains text (a string of length <code>S</code>) of an arbitrary length, but a fixed size. Beyond a certain length (let's call it <code>L</code>), the text is truncated and the remainder of the text is no longer visible. (Technically speaking, the range <code>[0,L)</code> is visible, the range <code>[L,S)</code> is not).</p>
  
  <p>What I want to do is find the length <code>L</code> for the text by counting only the <strong>visible</strong> number of characters in the <code>div</code>. Any characters beyond the cut-off point should be disregarded.</p>
  
  <p>I'm happy to use 3rd party libraries like jQuery etc if that will get the job done!</p>