Obtaining element height: clientHeight/offsetHeight/scrollHeight/getComputedStyle() (v4)

Revision 4 of this benchmark created on


Preparation HTML

<div>
Hello world!
</div>
<script>
var div = document.getElementsByTagName("DIV")[0];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
clientHeight
div.clientHeight;
ready
getComputedStyle().height
window.getComputedStyle(div).height;
ready
offsetHeight
div.offsetHeight;
ready
scrollHeight
div.scrollHeight;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.