getElementsByTagName vs getElementsByClassName (v21)

Revision 21 of this benchmark created on


Preparation HTML

<div class="div"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementsByTagName
document.getElementsByTagName("div").style['background'] = 'red';
ready
getElementsByClassName
document.getElementsByClassName("div").style['background'] = 'red';
ready

Revisions

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