I'm trying to loop through an array, using it's values to create a collection of elements to later be added to the DOM.
In doing so I'm using this code:
$().add($('<span />', {
class: 'child',
text: 'test'
})).appendTo('.container');
Or something similar... the generated element is not added to the collection. Here's a fiddle illustrating the same: http://jsfiddle.net/Dygerati/WTYSQ/2/
$().add? Why this construct ?