getElementsByName vs jQuery

Benchmark created by Steven on


Preparation HTML

<div name="test1">
</div>

<span name="test1">
</span>

<input type="text" name="test1">
</input>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
document.getElementsByName
document.getElementsByName("test1");
ready
jquery selector
$("[name]='test1'");
ready

Revisions

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

  • Revision 1: published by Steven on