Check if div exists (v14)

Revision 14 of this benchmark created 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
Property Lookup
$(".a")[0]
ready
.length
$(".a").length
ready
.hasClass()
$('body').hasClass('a')
ready
.size()
$(".a").size()
ready
querySelector
(document.querySelector('.a') !== null)
ready

Revisions

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