1
I am collecting the values selected by the user and playing in an array. After that, I created a loop to play these values in a string to print on the screen. The problem is that they’re all coming in one line with only one space between them. Follow code from the loop:
var descr = "";
for (var i = 0; i < nomes.length; i++) {
descr = descr + "\n" + nomes[i] + ": " + qtd[i];
}
descr = descr + "\n";
$("#itens").text(descr);
And what do you want, that the text jumps line? The n could be replaced by
<br>
, but it depends on what it is#itens
also.– BrTkCa
#items is a <H2>
– lufizi