I am currently working on a JavaScript function that modifies the size of certain content. In order to accomplish this, I need to obtain the height of a specific div element within my content structure. Below is an example of the HTML code I am dealing with:
<div id="wrapper">
... other elements ...
<div id="inner" style="height:400px">Text content goes here</div>
... other elements ...
</div>
Accompanied by the following JavaScript code snippet:
$('#inner').height('auto');
var height = $("#wrapper").height();
Upon testing, it was observed that in browsers like FireFox and Chrome, the 'height' variable updates as the inner div expands to accommodate all text content. However, in Internet Explorer, the height value remains unchanged. It seems that IE does not instantly redraw the div upon modification. Is there any solution or workaround to obtain the correct updated height in IE?
Thanks in advance!