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

  • Home
  • SEARCH
  • 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 7984647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:20:30+00:00 2026-06-04T11:20:30+00:00

I have a div containing text which is inside another div displayed only under

  • 0

I have a div containing text which is inside another div displayed only under certain circumstances. The HTML for this is simple and looks like:

<div id='parent'>
  <div id='child'>
    Some text inside child div
  </div>
</div>

The styling would look like:

#parent{ display:none; height:0px; }

Using jQuery I would like to obtain the height of the child as I would if the div was outside the parent.

The following javascript returns 0, I wish for something around maybe 15.

var child_height = $('#child').height();
alert(child_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-06-04T11:20:31+00:00Added an answer on June 4, 2026 at 11:20 am

    Try all these and just working fine:

    console.log($('#child').outerHeight());
    
    console.log($('#child').css('height'));
    
    console.log($('#child').height());
    

    According to you edit:

    var height = $('#parent').css({visibility: 'hidden', display : 'block'}).find('#child').height();
    
    $('#parent').css({visibility: 'hidden', display: 'none'});
    
    console.log(height);
    

    DEMO

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

Sidebar

Related Questions

I have a DIV containing text. Previously I just tried setting new HTML like
I have a div element containing some text. When the user clicks a word
I have a div, containing text and a few links. I want to trigger
I have a div containing an image that can be dragged around inside the
Hey so I have a div containing 3 links which have a background url
So I have 3 divs contained inside a containing div like such: <div id=contain>
Have a user form containing numerous lines similar to this: <h2>Parts of Body</h2> <div>
I have a div containing some content, in which there are some links. The
This is the problem. I have an div which includes a few paragraphs of
I have a div which contains a series of span tags, each containing a

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.