Get Attribute (v4)

Revision 4 of this benchmark created by John-David Dalton on


Description

Get Attribute test

Preparation HTML

<img src="link.png" alt="nada" id="img">
<script>
  var img = document.getElementById("img");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Get Attribute Node
var x = img.getAttributeNode('id').value;
ready
Get Attribute
var x = img.getAttribute('id');
ready
Element property
var x = img.id;
ready

Revisions

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

  • Revision 1: published by Lucas Monteverde on
  • Revision 4: published by John-David Dalton on
  • Revision 5: published by Oskar Krawczyk on