Reputation: 777
I'm trying to append data and have them appear on a new line
I've tried
$.each(data,function(label) { // loop over result
$("#labels").append(label._id+":"+label.label + 'br');
but it is not working.
Upvotes: 2
Views: 266
Reputation: 2859
You may also wrap the data in a block element like <div>
or <p>
to appear in a new line.
Upvotes: 1
Reputation: 777
Turns out you just need to inline the br like so
$.each(data,function(label) { // loop over result
$("#labels").append(data[label].label + '<br/>');
Upvotes: 2