CSS3 vs jQuery selectors

Benchmark created on


Description

jQuery pseudo selectors vs CSS3

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="content" class="service-container">
  <div id="one">
    One
  </div>
  <div id="two">
    Two
  </div>
  <div id="three">
    Three
  </div>
  <div id="four">
    Four
  </div>
  <div id="five">
    Five
  </div>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
CSS3
$('#content div:not(:nth-child(2))').hide();
ready
jQuery
$('#content div:nth-child(2)').siblings('div').hide();
ready
jQuery Filter
$('#content div').filter(':eq(2)').siblings('div').hide();
ready

Revisions

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