Javascript, trying to add linebreak inside create text node method

前端 未结 3 1974
执念已碎
执念已碎 2021-02-08 06:34

This is my script:



        
3条回答
  •  半阙折子戏
    2021-02-08 07:28

    A text node is a text node, if it contains a
    (or any HTML), it won't be parsed as HTML, as a text node's data is only treated as text.

    You could add...

    out.appendChild(document.createElement("br"));
    

提交回复
热议问题