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
Solved

NS 6.2.2 get height of a div tag?

Posted on 2002-04-23
4
849 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

838 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