Test name | Executions per second |
---|---|
querySelector | 1025014.9 Ops/sec |
getElementsByName | 1103788.0 Ops/sec |
getElementById | 979555.5 Ops/sec |
getElementsByClassName | 1064089.2 Ops/sec |
<div name='test' id='test' class='test'></div>
document.querySelector('#test')
document.getElementsByName('div[name="#test"]')
document.getElementById('test')
document.getElementsByClassName(".test")