I'm trying to get the "click()" function to display the value of 'i'
at the time I passed in the function. But its referring back to the value of 'i'
after it finished. I'm drawing a blank on how to get the function to refer to the value of 'i'
when I first passed the function in.
for( var i=0; i<10; i++){
var ts = $('#<span></span>').clone().click(function(){
alert(i);
});
}
NOTE:
The '#'
shouldn't be there, neither should the '.clone()'