Display formatted raw html with jquery

后端 未结 2 1973
别跟我提以往
别跟我提以往 2021-01-16 03:39

I have a place where I am trying to show code in a text area. I have dumbed down the example but basically user can input some fields, click a button, and the code snippet

2条回答
  •  感动是毒
    2021-01-16 04:36

    just use

     and add \n and space according to the needed layout

    edit:

    you can also write

    var mySnippet =
    "
    \n\
    \n\
    \n\
    ";

提交回复
热议问题