jquery vs javascript data (v102)

Revision 102 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 = $("#test");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
getAttribute
  $dom[0].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.