querySelectorAll and attribute selectors

Benchmark created by Tim Pietrusky on


Preparation HTML

<a href="#" data-js="print zoom">Print & Zoom</a>
<a href="#" data-js="print">Print</a>
<a href="#" data-js="zoom">Zoom</a>

Test runner

Ready to run.

Testing in
TestOps/sec
[att=val]
document.querySelectorAll('[data-js="print"]')
ready
[att~=val]
document.querySelectorAll('[data-js~="print"]')
ready
[att|=val]
document.querySelectorAll('[data-js|="print"]')
ready
[att^=val]
document.querySelectorAll('[data-js^="print"]')
ready
[att$=val]
document.querySelectorAll('[data-js$="print"]')
ready
[att*=val]
document.querySelectorAll('[data-js*="print"]')
ready

Revisions

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

  • Revision 1: published by Tim Pietrusky on