Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6205849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:20:41+00:00 2026-05-24T05:20:41+00:00

I am using javascript to display the height of my current div. This is

  • 0

I am using javascript to display the height of my current div.

This is an example of the effected area

//css
.test
{
height:1px;
}

#test1
{
margin:1px;
}

//html
<div id="test1" class="test"></div>

//javascript
var a = document.getElementById('test1');

a.style.height //how I access the style

Firebug says that the length of style is 0 and height is empty.
How can I access the correct height?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:20:41+00:00Added an answer on May 24, 2026 at 5:20 am

    You need to look at the computed style, not the specified style. See Quirks mode’s getstyle page which answers the question

    Sometimes you’ll want to see what styles the default document view has. For instance, you gave a paragraph an width of 50%, but how do you see how many pixels that is in your users’ browser?

    and it explains how to derive and use the getstyle function, though it’s easier to use a library like jquery which provides a simple css function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to set the max height of a css drop-down menu without using javascript?
I built a nav area using css (it triggers a javascript function to bring
I'm using this JavaScript tabbed script: http://net.tutsplus.com/tutorials/html-css-techniques/how-to-create-a-slick-tabbed-content-area/comment-page-2/#comments I have it working 100% if I'm
I am trying to add a <div> using JavaScript and then change its width/height/top/left
I am able to display my tweets in my website using the JavaScript below.
I'm using the WPF 3.5SP1 WebBrowser control to display a page containing some javascript
I'm trying to display an svg graph with associated javascript in my application using
Using JavaScript I open the pop window and parent window is inactive at this
I'm trying to display a modal form using jquery ui. I've adapted an example
is there any possibility to change an image's resolution on clientside (using CSS, Javascript,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.