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 empty string.
I have tried every way I know to escape the string properly, but to no avail.
<option value=""asd">test</option>
<option value="\"asd">test</option>
<option value=""asd">test</option>
<option value=""asd">test</option>
How do I render this on the page so the postback message contains the correct value?
Если Вы используете JavaScript и Lodash, то можно использовать _ .escape (), который выходит", ', <>, и &.
Посмотрите здесь: https://lodash.com/docs/#escape