Solved

NS 6.2.2 get height of a div tag?

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now