jquery vs javascript data (v101)

Revision 101 of this benchmark created by attr data on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<span id="test" data-status="ok"></span>
<script>
  var dom = document.getElementById("test");
  var $dom = $("#test");
  




</script>

Test runner

Ready to run.

Testing in
TestOps/sec
getAttribute
  dom.getAttribute("data-status");
ready
attr
  $dom.attr('data-status');
ready
data
  $dom.data('status');
ready

Revisions

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