jQuery .on() vs .click() (v44)

Revision 44 of this benchmark created by Hamed Al-Khabaz on


Description

test jquery

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<div id="context">
  <p id="p">
    <a id="#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.