Solved

NS 6.2.2 get height of a div tag?

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

810 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