jQuery find vs. children (v2)

Revision 2 of this benchmark created by devu on


Description

Comparing $('...').find('...') and $('...').children('...')

Preparation HTML

<div id="myID">
  <p>
    Some text
  </p>
  <p>
    Some text
  </p>
  <p>
    Some text
  </p>
  <p>
    Some text
  </p>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
find
$('#myID').find('p');
ready
children
$('#myID').children('p');
ready
find >
$('#myID').find('> p');
ready
pure JS
document.getElementById("myID").children[0]; //do what you want here
ready

Revisions

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

  • Revision 1: published by m--s on
  • Revision 2: published by devu on