jQuery: find() vs Descendant selectors vs Child selector (v9)

Revision 9 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div class="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
Descendant selectors
$('.replyForm a')
ready
Children method
$('.replyForm').children('a')
ready

Revisions

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