Is there a way to check if an element's text is overflowing its container?
For example, I have a <p>
with width: 100px
. This element has text that takes up 105px. I can see that my text-overflow: ellipsis
is applied, but I'd like to know in my JS too.
jQuery or plain js is fine.