How do I properly escape quotes inside HTML attributes?

前端 未结 6 865
遇见更好的自我
遇见更好的自我 2020-11-22 08:31

I have a drop down on a web page which is breaking when the value string contains a quote.

The value is \"asd, but in the DOM it always appears as an em

6条回答
  •  隐瞒了意图╮
    2020-11-22 09:23

    Another option is replacing double quotes with single quotes if you don't mind whatever it is. But I don't mention this one:

    
    

    I mention this one:

    
    

    In my case I used this solution.

提交回复
热议问题