Detect if text has overflown
<p>How can you detect if text has overflown? For example, the following text is longer than it's div container allows. How can I detect this in javascript?</p>

<pre><code>&lt;div style="max-width: 100px; white-space:nowrap; overflow: hidden;"&gt;
    Lorem ipsum dolor sit amet, consectetur adipisicing elit
&lt;/div&gt;
</code></pre>
