Hey guys I’m working on a new project and I need to send some text via jQuery to a pre tag.
Here is what I want to achieve:
I have this jQuery to add this text to a “pre” tag.
$('pre').text('Line 1, Line 2, Line 3, Line 4, Line 5');
But I don’t know how can I add this text via jquery to be formatted this way without using <br> tags
Is possible to do that?
That will work, thank you DPereyra
When I tested it on my project it didn’t worked. I’ve got an “Unexpected token Illegal”..
Are you sure that you copied the code correctly?
Yes, maybe it only works on a server.