Reputation: 1877
I am trying to do this:
var divString = '#sContainer' + [index];
$(divString).append(SSDisplay);
So that it is
var divString = '#sContainer' + [index];
$('#sContainer0').append(SSDisplay);
$('#sContainer1').append(SSDisplay);
$('#sContainer2').append(SSDisplay);
It doesn't seem to be working. I have also tried
$('#sContainer' + [index]).append(SSDisplay);
Any idea how I can get the jquery selector to do this dynamically?
Upvotes: 1
Views: 45
Reputation: 324790
You are repeatedly appending the same SSDisplay
.
Try:
$('#sContainer' + index).append( SSDisplay.clone(true) );
Upvotes: 1