Joined August 2013
·

Om Shankar

SuperJS
·
Bangalore
·
·

Posted to jQuery DOM creation tips over 1 year ago

I don't think this is a tip, as jQuery docs themselves mention it.
http://api.jquery.com/jquery/#example-1-1.

A tip would be something unusual, that helped an original problem.

Also, $('<div/>', { ... }) is an incredibly slow method.

$( document.createElement('div'), { ... }) can be a more faster alternative.

Also, if you had reference to document in a local variable, say doc, doc.createElement would be more optimised.

Achievements
9 Karma
0 Total ProTip Views