jQuery .on() vs .click() (v85)

Revision 85 of this benchmark created on


Description

test jquery

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</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
.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.