Get Div clientHeight and offsetHeight

You can get the Div height dynamically using JavaScript DOM methods. JavaScript document object provides getElementById function that returns the HTML object according to the specified id of the element. The object returned by getElementById method allows you to access the height of the specified Div element. Following are the properties accessible through JavaScript DOM:

1. clientHeight

2. offsetHeight

You can learn more about these properties from the tutorial link provided at the bottom and top of this sample.

Try the sample below to learn the working of JavaScript code for retrieving the height of the HTML div element dynamically:

Edit this code and click update to view output
OUTPUT:
  • HIRE EzineASP.Net Developers