perf difference

Benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
Append nodes
var myId = document.createElement("input");
  myId.setAttribute("type", "hidden");
  myId.setAttribute("name", "myId0");
  document.getElementById('myid').appendChild(myId);
ready
Write innerhtml
document.getElementById("myid").innerHTML += 
'<input type="hidden" name="myId0"/>';
ready

Revisions

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