[type=checkbox] vs :checkbox (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="foo">
  <div></div>
  <span></span>
  <input type="text">
  <input type="checkbox">
  <div></div>
  <span></span>
  <input type="text">
  <input type="checkbox">
  <div></div>
  <span></span>
  <input type="text">
  <input type="checkbox">
  <div></div>
  <span></span>
  <input type="text">
  <input type="checkbox">
  <div></div>
  <span></span>
  <input type="text">
  <input type="checkbox">
  <div></div>
  <span></span>
  <input type="text">
  <input type="checkbox">
  <div></div>
  <span></span>
  <input type="text">
  <input type="checkbox">
  <div></div>
  <span></span>
  <input type="text">
  <input type="checkbox">
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
[type=checkbox]
$("#foo [type=checkbox]");
 
ready
:checkbox
$("#foo :checkbox");
 
ready
input[type=checkbox]
$("input[type=checkbox]");
ready
input:checkbox
$("input:checkbox");
ready

Revisions

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