Test name | Executions per second |
---|---|
$jq1124 | 18909.4 Ops/sec |
$jq224 | 24442.9 Ops/sec |
$jq331 | 25060.6 Ops/sec |
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js'></script>
<script>
var $jq1124 = $.noConflict(true);
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script>
var $jq224 = $.noConflict(true);
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
var $jq331 = $.noConflict(true);
</script>
<div>
<ul id="menu">
<li class="menu-item">1</li>
<li class="menu-item">2</li>
<li class="menu-item">3</li>
<li class="menu-item">4</li>
</ul>
</div>
function tests($) {
$(".menu-item").eq(2).closest("ul").css({
"background-color": "red"
}).parent().css({
"border": "1px solid blue"
}).append($("<p></p>").text("Text.").css({
"background-color": "green"
})).end().end().remove();
console.log('tests' + $);
}
tests($jq1124);
tests($jq224);
tests($jq331);