Check if div exists (v11)

Revision 11 of this benchmark created by Antonio on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
.size()
$(".a").size()
ready
querySelector
(document.querySelector('.a') !== null)
ready
.hasClass()
$('body).hasClass('a')
ready
Property Lookup
$(".a")[0]
ready
.length
$(".a").length
ready

Revisions

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