jQuery element creation (v18)

Revision 18 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
With trailing slash
$('<div/>', {text: 'cat', style: 'background: red'});
ready
Without trailing slash
$('<div>', {text: 'cat', style: 'background: red'});
ready
Opening and closing tags
$('<div></div>', {text: 'cat', style: 'background: red'});
ready
document.createElement
$(document.createElement('div')).text('cat').css({background: 'red'});
ready

Revisions

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