Create an Empty jQuery Object

by Sanju 2012-09-14 15:56:46

Create an Empty jQuery Object

Creating a new jQuery object can bring significant overhead. Sometimes, you might need to create an empty object, and fill it in with the add() method later.

var container = $([ ]);
container.add(another_element);


This is also the basis for the quickEach() method that you can use as a faster alternative to the default each().

Tagged in:

1122
like
0
dislike
0
mail
flag

You must LOGIN to add comments