jQuery CSS vs addClass speed (v11)

Revision 11 of this benchmark created by asd on


Description

asfd

Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

<style type="text/css">
.newClass {
width:"100px";
}
</style>

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

Teardown


    $('div').remove();
    $('body').append('<div class="some preexisting classes"></div>');
    
  

Test runner

Ready to run.

Testing in
TestOps/sec
Add class
$('div').css('visibility', 'hidden').css('display', 'none');
ready
Apply CSS
$('div').css({
'visibility':'hidden',
'display':'none'
});
ready

Revisions

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