hasClass in jQuery vs Prototype (v4)

Revision 4 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script>
  $.noConflict();
</script>
<script src="//ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js">
</script>
<script src="//ajax.googleapis.com/ajax/libs/mootools/1.3/mootools-yui-compressed.js"></script>
<div id="el" class ="found"></div>

Setup

var el1 = jQuery('#el'),
        el2 = $$('el');

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery hasClass
el1.hasClass('found');
el1.hasClass('missing');
ready
Prototype hasClassName
el2.hasClassName('found');
el2.hasClassName('missing');
ready
Mootools hasClass
el2.hasClass('found');
el2.hasClass('missing');
ready

Revisions

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

  • Revision 1: published by Jordan Boesch on
  • Revision 2: published on
  • Revision 3: published by Duncan Cheuk Kan Ma on
  • Revision 4: published on