Check if div exists

Benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div class="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

Revisions

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