Test name | Executions per second |
---|---|
querySelector | 7405263.0 Ops/sec |
querySelectorAll | 3333946.0 Ops/sec |
getElementsByClassName | 8939839.0 Ops/sec |
querySelector (ID) | 5502022.5 Ops/sec |
getElementsByID | 8612729.0 Ops/sec |
<div class="test" id="test"></div>
document.querySelector(".test")
document.querySelectorAll(".test")
document.getElementsByClassName(".test")
document.querySelector("#test")
document.getElementById("test")