Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
At a high level, you’re generating html from JavaScript, so any html which would work standalone will work when generated from JavaScript too. Some possibilities, with varying flexibility:
Pre-formatted text, insert newline
"\n"characters:Inserting break tags:
Or my favourite, use paragraph tags:
I like this because you can refer to each line in code as a single DOM element. Set this css to keep the lines side-by-side: