0

Is there a function that would return the pixel height of a div? I want to add images to the side of said div based on the size of the div (which would be dependent on the user's content, and would change the size of the div)

Thanks!

user856358
  • 573
  • 1
  • 7
  • 18

2 Answers2

2

document.getElementById('divId').offsetHeight should give you the height.

Yuriy Galanter
  • 38,833
  • 15
  • 69
  • 136
1

If using jQuery:

<div id="something">...</div>

jQuery:

$("#something").height();
eclipsis
  • 1,541
  • 3
  • 20
  • 56