Jump to content

How to fetch the exact height attribute of html divs in IE?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
greenerworld007

greenerworld007

    Newbie

  • Members
  • Pip
  • 2 posts
Hi,

I want to get the dynamic heights of some html divs. I am not programmatically applying height to them (so I don't know their values). If I fetch the height in mozilla I am able to fetch the exact value in px but in case of IE it gives "auto". How do I get their exact values? Please help

#2
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
<html>
<head>
<title>Test Height</title>
</head>
<body>
<div style="height:32px;border: 2px solid green;" id="one"> hello world</div>
<a href="javascript:alert(document.getElementById('one').style.height);">Click</a>
</body>
</html>