jQuery on click vs click

JavaScript performance comparison

Test case created

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="s-controller">
                <div class="inside">
                    <ul class="s-buttons list-buttons">
                        <li><a href="#participantes" class="s-open active">F</a></li>
                        <li><a href="#apoyos" class="s-open active">R</a></li>
                        <li><a href="#info" class="s-open">X</a></li>
                    </ul>
                </div>
            </div>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
on click
jQuery('#s-controller').on('click', '.s-open', function() {

});
pending…
on click elem
jQuery('.s-open').on('click', 'a.s-open', function() {

});
pending…
click
jQuery('.s-open').click(function() {

});
pending…

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

Compare results of other browsers

0 comments

Add a comment