Is there a method in JavaScript to calculate the height of content in order to adjust the container's height accordingly?
For instance, if I have a div with a height of 200px but the content inside only takes up 40px of that space. How can I determine the height if I were to add more content?