Test name | Executions per second |
---|---|
clientWidth | 403899.2 Ops/sec |
offsetwidth | 1977287.2 Ops/sec |
window.getComputedStyle | 174958.6 Ops/sec |
<div id="teste">teste</div>
var teste_n = '123px';
var _style = window.getComputedStyle(document.getElementById('teste'));
document.getElementById('teste').clientWidth;
document.getElementById('teste').offsetwidth;
parseFloat(_style['width'])