Home > Article > Web Front-end > The phenomenon that offsetHeight is 0 in OnLoad_javascript skills
When using IE, especially in the current div css method, the height of the div is often not defined. This is because when you need to obtain the height of the div after adding the div content, you often need to use offsetHeight.
In use, sometimes you will encounter the phenomenon that offsetHeight is obtained as 0, but if you use various JS debugging tools to debug, you can see the value in the object (it is worthless if you point it directly to offsetHeight , but if the object view has a value, the object has been refreshed by pressing Enter in the debugger, so it has a value)
For example, the following fragment