jQuery: Child selector vs .find() (v11)

Revision 11 of this benchmark created by tester on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="replyForm">
  <a href="#">Reply</a>
  <form class="whatever" action="" method="post">
    <input type="text" name="message" placeholder="" />
    <div class="formControls">
      <input type="submit" value="Send" name="sendButton" class="submit-widget button-field"
      />
    </div>
  </form>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
.find()
$('#replyForm').find('> a')
ready
Child selector
$('#replyForm > a')
ready
Children method
$('#replyForm').children('a')
ready
All Selectors then replyform test
$('#replyForm a')
ready
Find only
$('#replyForm').find('a')
ready

Revisions

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