Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: How can I find the height of an element?


Message #1 by brian.lowe@x... on Wed, 14 Aug 2002 13:00:02
<div id="myDivision" style="width: 100px">
Here is some text<br>and I don't know the width<br>or the height...<br>BUT
</div>
<input type="button" value="press here to find out..." onclick="var oDiv =
document.getElementById('myDivision'); alert(oDiv.clientWidth+' by '
+oDiv.clientHeight+' pix')">

Perfect! Thank you.

I have used clientWidth and clientHeight before. I don't know why they 
didn't come to mind while I was thinking about this, or why my seraches 
didn't lead me to them!

Thanks again

Brian Lowe
--------@


  Return to Index