HTML: <textarea>-Tag: How to correctly escape HTML and JavaScript content displayed in there?

前端 未结 2 1027
盖世英雄少女心
盖世英雄少女心 2020-12-11 14:47

I have a HTML Tag and the $FOO Variable will be filled with arbitrary HTML and JavaScript Content, to be disp

2条回答
  •  自闭症患者
    2020-12-11 15:38

    You need to replace the special character of HTML with character references (either numerical character references or entity references), in textarea, at least &, < and >.

提交回复
热议问题