jquery vs createElement with adding classes (v116)

Revision 116 of this benchmark created 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
var test = $('<span>', {class: "fa fa-times"});
ready
jquery with attr
var test = $('<span>').attr("class", "fa fa-times");
ready
createElement with attr
var test = $(document.createElement('span')).attr("class", "fa fa-times");
ready
createElement and attr
var test = document.createElement('span');
$(test).attr("class", "fa fa-times");
ready

Revisions

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