removeattr vs attr NULL

Benchmark created by sandeep 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').removeAttr('title')
ready
attr NULL
$('#ancTest').attr('title', '')
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