Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

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

HTML

  • Please log in to reply
1 reply to this topic

#1 greenerworld007

greenerworld007

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 05 November 2009 - 05:02 AM

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
  • 0

#2 BlaineSch

BlaineSch

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1559 posts

Posted 05 November 2009 - 08:10 AM

<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>

  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download