jquery and js selector comparison

Benchmark created by Tailo Mateus Gonsalves on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<div id="my-id">
        <div class="my-class">
            <p> I like JS! </p>
        </div>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
Jquery
$('#my-id .my-class');
ready
JS
document.querySelector('#my-id .my-class');
ready

Revisions

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

  • Revision 1: published by Tailo Mateus Gonsalves on