jquery vs createElement with class (v91)

Revision 91 of this benchmark created by Melinda on


Preparation HTML

<script src="http://code.jquery.com/jquery-2.1.4.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"></span>');
ready
jquery (HTML, self closing)
var test = $('<span class="testClass" />');
ready
jquery (addClass)
var test = $('<span></span>');
test.addClass('testClass')
ready

Revisions

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