Solved

NS 6.2.2 get height of a div tag?

Posted on 2002-04-23
4
852 Views
Last Modified: 2013-11-19
Hi,
according to this code I shoud get an alert box with height of the div one but getting empty alert box.
I need to get the height of div one.


<HTML>
<HEAD>
<TITLE> Check Height In NS 6.2.2 </TITLE>
<style type="text/css">
#one{
height:300;
width:200;
background:yellow;
}
</style>
<script language="javascript">
function check(){
     var elm = document.getElementById("one");
     alert(elm.style.height);
}

</script>
</HEAD>
<body >
<form name=frm>
<div id="one">
Test The Height Property
</div>
<input type=button name=btn1 value="getHeight"onclick="check()">
</form>
</BODY>
</HTML>
0
Comment
Question by:tejaspurani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 50 total points
ID: 6962839
IE will give it to you off the style, but Netscrap appears not to populate some of the style object during initial load.  

Try: document.getElementById("one").offsetHeight

Which will pick it up in NS6.

Cd&
0
 
LVL 3

Author Comment

by:tejaspurani
ID: 6962913
Thanks,

one more thing where can i find reference for things
like this.I mean I was surfing on net and never came to
the know the word like offsetheight.

thanks again

T.P.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6962973
The definitive source of the document object model:


http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/

Thanks for the A. :^)

Cd&
0
 
LVL 3

Author Comment

by:tejaspurani
ID: 6963831
Thanks.

Tejas
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Wordpress and Wufoo 1 39
Bootstrap question 4 33
Use "if not" in a condition 2 19
Html split(text) Part2 6 23
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question