Question: I want to get the height of the paragraph element inside a class element.

For example my html code:

```
<div class="myClass">
    <p> here goe's some awesome text </p>
</div>

<div class="myClass">
    <h1>Some Heading</h1>
    <p>another great text</p>
</div>

```

Now i want to get access to the total height of the div element, but also want to get access to the height of the child element p.

I tried with `getElementsByClassName('myClass').children('p')`, but that doesn't work.
I want to set the height of the div with jQuery, on document ready the height should be the height of div-element minus the height of the divs p element.

Something like:

```
var divs = $(document).getElementsByClassName('myClass');
for (var i = 0; i < divs.length; i++){
    divs[i].style.height = divs[i].height() - divs[i].children('p').height();
}

```

I'm not sure how the actual correct code would look like, or if there is even a way to get the height of the child p element.

Answer: 
With Jquery you can search for the `p` inside each `myClass` element. Try this:

```
$(document).ready(function(){
    $('.myClass').each(function(){
        var h = $(this).find('p').height();
        alert(h)
    })
})

```

Check this **[DemoFiddle](http://jsfiddle.net/zx58xgu8/)**
You can do something like this simple , Using **[`css()`](http://api.jquery.com/css/#css-propertyName-function)** jquery method with callback function

```js
$('.myClass').css('height', function(i, v) {
  return parseInt(v, 10) - parseInt($(this).children('p').height(), 10);
});
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="myClass">
  <p>here goe's some awesome text</p>
</div>

<div class="myClass">
  <h1>Some Heading</h1>
  <p>another great text</p>
</div>
```