Select Element Generation

Benchmark created on


Description

Select Element Generation compate JQuery v.s. JS

Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
var s = $("<select></select>");
s.attr("id", "myId");
for (i = 0; i < 10; i++) {
  var o = $("<option></option>");
  o.val(i);
  o.text(i);
  s.append(o);
}
ready
JS
var s = document.createElement('select');
s.id = "myId";

for (i = 0; i < 10; i++) {
  var o = document.createElement('option');
  o.value = i;
  o.text = i;
  s.appendChild(o);
}
ready

Revisions

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