jquery vs createElement with class (v86)

Revision 86 of this benchmark created by Jens Duttke on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
jquery (HTML, no end tag)
var test = $('<span class="testClass">');
ready
createElement
var test = $(document.createElement('span'));
test.className += " testClass";
ready
jQuery (Object)
var test = $('<span></span>', {
  'class': 'testClass',
})
ready
document.create no jQuery
var test = document.createElement('span');
test.classList.add("testClass");
ready
jquery (HTML, end tag)
var test = $('<span class="testClass"></div>');
ready

Revisions

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