Element Width

Benchmark created by Hugo Dias on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<div id="test"> Testing </div>

Test runner

Ready to run.

Testing in
TestOps/sec
offsetWidth
var width = document.getElementById('test').offsetWidth;
ready
getBoundingClientRect
var width = document.getElementById('test').getBoundingClientRect().width;
ready

Revisions

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

  • Revision 1: published by Hugo Dias on
  • Revision 2: published by iofjuupasli on