Ricky
Ricky

Reputation: 777

How do I append new line in pug?

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

Answers (2)

Gibin Ealias
Gibin Ealias

Reputation: 2859

You may also wrap the data in a block element like <div> or <p> to appear in a new line.

Upvotes: 1

Ricky
Ricky

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

Related Questions