jQuery element creation

JavaScript performance comparison

Revision 16 of this test case created

Preparation code

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

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
With trailing slash
var element = $('<li class="row"><ul><li class="name" >http://test.com</li><li>test</li></ul></li>');
pending…
Without trailing slash
var element = document.createElement('li');
element.setAttribute("class", "row");
var ulElement = document.createElement('ul');
element.appendChild(ulElement);
var liFirst = document.createElement('li');
liFirst.setAttribute("class", "name");
var txtFirst = document.createTextNode('http://test.com');
liFirst.appendChild(txtFirst);
var liSecond = document.createElement('li');
var txtSecond = document.createTextNode('http://test.com')
liSecond.appendChild(txtSecond);
ulElement.appendChild(liFirst);
ulElement.appendChild(liSecond);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment