spread html in multiple lines javascript

前端 未结 4 1684
轻奢々
轻奢々 2021-02-05 21:09

I want to put the below html code in my javascript function. I don\'t want to put it all next to each other. Is it possible to the code in the same way as how it is in html? Cod

4条回答
  •  广开言路
    2021-02-05 21:40

    Generating html from javascript directly ties logic and presentation together. It also garbles your code.

    You can use a javascript templating engine like pure to get a clear separation of logic and presentation.

提交回复
热议问题