4 <title>Test Event Handling Performance</title>
5 <script src="benchmark.js"></script>
6 <script src="jquery-basis.js"></script>
7 <script>var old = jQuery.noConflict(true);</script>
8 <script src="../dist/jquery.js"></script>
10 jQuery(function ready() {
11 var node = $("#child"), name;
13 [".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"].forEach(function foreach(item) {
14 name = "closest '" + item + "'";
17 console.log("new", benchmarkString("$('#child').closest('" + item + "')", 5000, name));
18 console.log("old", benchmarkString("old('#child').closest('" + item + "')", 5000, name));
26 <div class="zoo" id="zoo" data-foo="bar">
28 <p id="child">lorem ipsum</p>