Different Ways to get an Element's Dimensions with DOM Scripting
The box below has dimensions set in the CSS at 205.3px by 198.8px. Using JavaScript, you can get the width and height values, but the results may differ depending on what DOM method or property you use.
The button below grabs the box's width and height in six different ways, each of which will be displayed on the page when the button is clicked.