removeattr vs attr NULL (v2)

Revision 2 of this benchmark created by Michael on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<a href="index.html" title="this is testing" id="ancTest">Test</a>

Test runner

Ready to run.

Testing in
TestOps/sec
removeAttr
$('#ancTest').attr('style', 'color: red;');
$('#ancTest').removeAttr('style');
ready
attr NULL
$('#ancTest').attr('style', 'color: red;');
$('#ancTest').attr('style', '');
ready

Revisions

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

  • Revision 1: published by sandeep on
  • Revision 2: published by Michael on