?
Solved

NS 6.2.2 get height of a div tag?

Posted on 2002-04-23
4
Medium Priority
?
861 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 200 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

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
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.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

765 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