Create tag with jquery

Benchmark created on


Description

Which of the techniques is faster to create a tag in jquery.

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script>
  var johnLewis = {};
  johnLewis.Module = {};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Using variable
var mask = '<div class="modClass"></div>',
    maskElem = $(mask);
ready
straight into object
var straightMask = $('<div class="modClass" />');
ready

Revisions

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