jQuery click vs bind vs on (v5)

Revision 5 of this benchmark created by Curt Sheller on


Description

Tests performance of jQuery event listeners.

Preparation HTML

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

Setup

< div id = "main" > < /div>

Test runner

Ready to run.

Testing in
TestOps/sec
click
$("#main").click(function() {});
ready
bind
$("#main").bind("click", function() {});
ready
on
$("#main").on("click", function() {});
ready

Revisions

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