how to show <html> in textarea

后端 未结 2 1285
闹比i
闹比i 2020-12-21 18:26

In textarea, I load text from database and then show in textarea. I have a problem, textarea not show < and >. It has been changed to

2条回答
  •  孤城傲影
    2020-12-21 18:57

    Escape the & by using &.

    Change this:

    
    

    To this:

    
    

    If you're using PHP you can automatically do this with htmlspecialchars().

提交回复
热议问题