jQuery .on() vs .click() (v61)

Revision 61 of this benchmark created on


Description

test jquery

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<div class="context">
  <p class="p">
    <a class="test"> click me</a>
    <a class="test"> click me</a>
    <a class="test"> click me</a>
<a class="test"> click me</a>
<a class="test"> click me</a>
<a class="test"> click me</a>
  </p>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
.on() with guard
$('.p').on('click', '.test', function() {
  alert('me aahe');
});
ready
.click()
$('.test').click(function() {
  alert('me aahe');
});
ready
.delegate()
$('.test').delegate('click', function() {
  alert('me aahe');
});
ready
.on()
$('.test').on('click', function() {
  alert('me aahe');
});
ready

Revisions

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