jQuery CSS3 Not vs. .Not() (v36)

Revision 36 of this benchmark created by npjohns on


Preparation HTML

<div id="container">
      <div id="header"> Header </div>
      <div>Div</div>
      <div id="footer"> Header </div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
CSS3 Selector
$('div').filter(':not(#header)');
ready
Not() Method
$('div').not('#header');
ready
reuse Not()
var d = $('div');
d.not('#header');
d.not('#footer');
ready
CSS3 instead of reuse
var d = $('div');
$('div:not(#header)');
$('div:not(#footer)');
ready

Revisions

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