Check if div exists (v7)

Revision 7 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div class="a"></div>
<div id="a"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
Property Lookup
$(".a")[0]
ready
.length
$(".a").length
ready
.hasClass()
$('div').hasClass('a')
ready
.size()
$(".a").size()
ready
$('#id')[0]
$('#a')[0]
ready
document.getElementById
document.getElementById('a')
ready
window[id]
window['a']
ready

Revisions

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