\n is not creating a new line between text in javascript

前端 未结 4 1689
迷失自我
迷失自我 2021-01-17 05:41

I have a piece of JavaScript that is supposed to update a in my HTML:

var StringContent = ({
    \"a\": \'Some String a\',
    \"b\": \'Some string b\',
            


        
4条回答
  •  情深已故
    2021-01-17 06:14

    CSS! white-space! pre-wrap! Learn about it!

    SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE! Newlines totally work now!

提交回复
热议问题