We know that to get the actual width and height of an element, you can use the currentStyle attribute in IE. But if the width and height of the element are not explicitly set, then this attribute will not be obtained, and the obtained value will be auto. As follows
abcd
<script> <br>var div = document.getElementsByTagName('div')[0]; <br>alert(div.currentStyle.width); <br>alert(div.currentStyle.height); <br> </script>
The output in IE6/7/8/9 is auto. If the displayed width and height are set, the output is the actual width and height. As follows
abcd
<script> <br>var div = document.getElementsByTagName('div')[0]; <br>alert(div.currentStyle.width); <br>alert(div.currentStyle.height); <br></script>
abcd
<script> <br>var div = document.getElementsByTagName ('div')[0]; <br>alert(div.currentStyle.width); <br>alert(div.currentStyle.height); <br></script>