getElementsByTagName vs getElementsByClassName (v18)

Revision 18 of this benchmark created on


Preparation HTML

<div class="ours" name="mine"></div>
<div id="mine"></div>

<script>
d=window.document;
if( d.getElementsByName('mine')[0] === d.getElementById('mine') ){
   alert('sassyfrass! name and id confusion');
}
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
TagName
d.getElementsByTagName("div");
ready
ClassName
d.getElementsByClassName("ours");
ready
Name
d.getElementsByName("mine");
ready

Revisions

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