attr name vs. element name

Benchmark created by SurelyPlus on


Description

Compares jQuery attr operator for the name attribute vs. native html element name write access.

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

<div id="test">test</div>
 
<script>
  var tdiv = $('#test');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery attr
tdiv.attr('name', 'visible');
ready
HTML element name attribute
tdiv.name = 'visible';
ready

Revisions

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

  • Revision 1: published by SurelyPlus on