removeAttr

JavaScript performance comparison

Test case created by return

Preparation code

<script src="https://gist.github.com/raw/4533942/53e1aa35454893d1d97dfc16e9a580b14c7310a2/jQuery.removeAttr%20modified"></script>

<div id="test" removeme removemetoo="2"></div>
<span class="test" lalala></span><span class="test" lalala></span>
      
<script>
Benchmark.prototype.setup = function() {
  var
      $testDiv = $('#test'),
      $testSpans = $('.test');

};
</script>

Preparation code output

<div id="test" removeme removemetoo="2"></div> <span class="test" lalala></span><span class="test" lalala></span>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Remove old
$testDiv
  .attr('removeme', null)
  .attr('removemetoo', null);

$testSpans
  .attr('lalala', null);
pending…
Remove new
$testDiv
  .attrNew('removeme', null)
  .attrNew('removemetoo', null);

$testSpans
  .attrNew('lalala', null);
pending…

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

Compare results of other browsers

0 Comments