Best way to create new DOM elements [closed]

Check this to find out for your self.

Creating DOM notes using jQuery
Note higher is better (OPS/Sec = operations per second = how many times per second the given code executes)

And the test winner in every other browser than Opera:

var form = document.createElement("form"),
    $form = $(form);
form.action = options.action;

NOTE:

the native method will be even faster if you don’t need a jQuery object:

var form = document.createElement("form");
form.action = options.action;

Leave a Comment