0

I have a div with some dynamic content which is plain text. I have also applied max-height to it and thus, some of the content might not be displayed. What I want to check is if the whole content is displayed after rendering.

So, my question is:

Is it best practice to check if offsetHeight < scrollHeight to see if the whole content of the div is displayed regarding its height?

vchan
  • 835
  • 2
  • 11
  • 27

1 Answers1

0

JQuery's innerHeight can be better than offsetHeight because it includes paddings, see this answer

Here's how to get innerHeight without jQuery: Get innerWidth() equivalent without jQuery

GaloisGirl
  • 1,476
  • 1
  • 8
  • 14