$().click vs addEventListener (v15)

Revision 15 of this benchmark created on


Preparation HTML

<div id="test"></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
  var func = function() {};

</script>

Setup

var elm = document.getElementById("test");
    var $elm = $(elm);

Test runner

Ready to run.

Testing in
TestOps/sec
$().click
$elm.on("click", func);
$elm.off("click", func);
 
ready
addEventListener
elm.addEventListener("click", func, false);
elm.removeEventListener("click", func, false);
 
ready

Revisions

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