# To het element's height and width

**URL:** <https://www.ruby-forum.com/t/to-het-elements-height-and-width/154622>\
**Category:** Rails\
**Created:** [December 2, 2008, 9:43am UTC](https://www.ruby-forum.com/t/to-het-elements-height-and-width/154622 "2008-12-02T09:43:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [December 2, 2008, 9:43am UTC](https://www.ruby-forum.com/t/to-het-elements-height-and-width/154622/1 "2008-12-02T09:43:08Z")

</div>

Hi…  
i m trying to give my form opacity effect with external javascript.  
In that i want to get div element’s height and width.  
My div width is fixed like 500px.  
Height is not fixed one.  
According to the content it ill be resized.  
so i used like below  
var dimensions = element.getDimensions();  
so it gives me height and width.  
but gives only in FIrefox.  
It doesn’t Work in IE 7.  
so i want to know how can i get height and width of div in IE7.  
and could u tell me whether the below code work in IE7 or not?  
var dimensions = element.getDimensions();  
Pls help ME

Online

Report | Delete | Edit | Quote

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [December 2, 2008, 11:14pm UTC](https://www.ruby-forum.com/t/to-het-elements-height-and-width/154622/2 "2008-12-02T23:14:16Z")

</div>

Newb N. wrote:

> so i want to know how can i get height and width of div in IE7.

element.getHeight() and element.getWidth()?

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [December 3, 2008, 5:06am UTC](https://www.ruby-forum.com/t/to-het-elements-height-and-width/154622/3 "2008-12-03T05:06:16Z")

</div>

Shandy N. wrote:

> Newb N. wrote:
> 
> > so i want to know how can i get height and width of div in IE7.
> 
> element.getHeight() and element.getWidth()?

But it doesn’t work with IE7
