.on() vs. .bind() vs. .delegate(). vs. .native() -jQuery 3.7 (v4)

Revision 4 of this benchmark created on


Description

What event binding is the most efficient.

Updated to jQuery 3.7.0

Preparation HTML

<a href="#"></a>
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>

Setup

var $link = $('a');

Test runner

Ready to run.

Testing in
TestOps/sec
.on()
$link.on('click', function() {});
ready
.on() 2
$(document).on('click', $link, function() {});
ready
.delegate()
$(document).delegate($link, 'click', function() {});
ready
.native()
$link.click(function() {});
ready

Revisions

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