jQuery .find() vs context, w/o special case (v13)

Revision 13 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id='myDiv'>
        <p>hello <a href="http://www.example.com/">link</a></p>
        <p>world <a href="http://www.example.com/">link</a></p>
</div>
<script>
  if (!window.console || !window.console.log) {
   throw 'console.log() is not supported. Please install Firebug. http://getfirebug.com'
  }
</script>

Setup

var myDiv  = "#myDiv";
    var $myDiv = $("#myDiv");

Test runner

Ready to run.

Testing in
TestOps/sec
.find()
$myDiv.find('a');
ready
context
$('a', myDiv);
ready

Revisions

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