The easiest way to check if the displayed text is larger than the container

I want to run an animation that will run the text, in case the text slides out of the div, well, what is the easiest way to check if the displayed text will slide out of the div?
Thanks.