Need to get Height and Width of an object (Mozilla 1.4)

Giganews Newsgroups
Subject: Need to get Height and Width of an object (Mozilla 1.4)
Posted by:  Jack Black (jackblackisba…@hotmail.com)
Date: Sat, 19 Jul 2003

Using Mozilla 1.4...  I need to get the Height and Width of an object (in
this case, a parent DIV) for the purpose of creating a textbox of max width
and height in the container.  Since innerHeight/Width don't work correctly
in Mozilla 1.4, I've tried using getComputedStyle as noted in another
newsgroup, but with no success; errors tend to range from "Cannot create
object in this context" to other various errors...

The below sample doesn't work, so I'm hoping someone can help me with a
coherent approach that will work... :)

Thanks!
Jack

winW=document.defaultView.getComputedStyle(document.getElementById('myContai
ner'),null).getPropertyValue('width');

Replies