hasClass (v24)

Revision 24 of this benchmark created on


Preparation HTML

<span class="class1 someother class2">Test</span>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
hasclass
if ($('span').hasClass('class1') && $('span').hasClass('class2')){
console.log('hasClass')
}
ready
hasclass2
if ($('span').hasClass('class2 class1')){
console.log('hasClass2')
}
ready

Revisions

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