[[Javascript]] width and height of an element

Bernu Bernard bernu at lptmc.jussieu.fr
Sun Sep 24 11:42:38 CDT 2006


Thanks for your response but it does not answer my needs.

The site you mentioned give a size of an element which has that size  
(width or height) already set.

My question is what you do when the browser decides the width and  
size of the element.
The usual need is when you precise the width and you want to find  
what the browser has set for the height.

When you directly ask the height you get nothing (null or undefined).

Bernard
Le Sep 24, 2006 à 6:33 PM, Lee Hinde a écrit :

> On 9/24/06, Bernu Bernard <bernu at lptmc.jussieu.fr> wrote:
>> Hi list,
>>
>> How can I find the width and size of an element ?
>>
>> Say for example I have :
>>
>> <div id="test" onclick="getsizes()">hello</div>
>>
>> When I click on "hello" I'd like to get the width and height of this
>> element.
>>
>> Bernard
>> _______________________________________________
>
>
> Google is your friend. I found this:
>
> http://www.aspandjavascript.co.uk/javascript/javascript_api/ 
> get_element_width_height.asp
>
> (o, google est vous ami? :-) )
> -- 
> Mark Twain: "What gets us into trouble is not what we don't know. It's
> what we know for sure that just ain't so."
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list