I\'m trying to concatenate strings via for loop but i\'m receiving NaNs. What i want to achieve is to get one concatenated string Div #0, Div
for loop
NaNs
Div #0, Div
Don't declare a new str variable inside the loop with var str. Reuse the one you declare outside the loop. Also do +=
str
var str
+=
var divLength = $('div').length; var str = ''; for(var i=0; i