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.
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.