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

Revision 7 of this benchmark created on


Preparation HTML

<script src="//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('.formControls')
ready
next to
$('.replyForm .formControls')
ready
inside
$('.formControls', $('.replyForm '))
ready
different inside
$('.formControls', '.replyForm ')
ready
diferent find
$('.whatever', $('.replyForm')).find('.formControls')
ready
diferent inline
$('.whatever .formControls', $('.replyForm'))
ready

Revisions

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