jquery .eq vs native js

Benchmark created by Rizwan on


Description

test for jquery eq element vs traditional javascript

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<ul id="posul">
        <li>position 1</li>
        <li>position 2</li>
        <li>position 4</li>
        <li>position 5</li>
</ul>

Test runner

Ready to run.

Testing in
TestOps/sec
jquery
$('#posul li').eq(2)
ready
javascript
var ul = document.getElementById('posul');

ul.children[2];
ready

Revisions

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