Is there a way to apply CSS to an element if the text inside the element exceeds a certain length. For example, <p class="foo">123456789</p> .
Then, when the text inside the element exceeds x characters, a new class is applied
<p class="foo text-exceeds-X-chars">12345678910101010101</p>
javascript jquery html css html5
Adam scot
source share