jquery vs javascript data (v103)

Revision 103 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"></span>
<script>
  var $dom = $("#test");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
getAttribute
  $dom[0].setAttribute("data-status", "valor");
ready
attr
  $dom.attr('data-status', 'valor');
ready

Revisions

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