I have a string that has line breaks at the end of each line like the one I have below:
1
12
123
1234
12345
123456
1234567
12345678
123456789
12345678
1234567
123456
12345
1234
123
12
1
This is from a string variable which I want to set to a paragraph tag in HTML. I tried using the innerHTML method but it only printed my results without the line breaks.
Any idea on how I can accomplish this task?