Please take a look at the following code. I am going through it and wondering what does .clone()
do here in the context of my code.
The jQuery documentation says that "The .clone() method performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes."
var x = 0;
functionPick()
{
var $loading = $('<img src="../images/loading-small.gif" wth="16" height="16">...Preparing');
var y = '';
y = '?ID=' + encodeURIComponent(<cfoutput>#ID#</cfoutput>);
if(x != 0)
{
x.remove();
x = 0;
}
x = $('<div></div>').append($loading.clone());
Please explain.