xhtml - How to properly escape quotes inside html attributes? -


i have drop down on web page breaking when value string contains quote.

the value "asd in dom appears empty string.

i have tried every way know escape string no avail.

<option value=""asd">test</option> <option value="\"asd">test</option> <option value="&quot;asd">test</option> <option value="&#34;asd">test</option> 

any idea how render on page postback message contains correct value?

&quot; correct way, third of tests:

<option value="&quot;asd">test</option> 

you can see working in jsfiddle example here. alternatively, can delimit attribute value single quotes:

<option value='"asd'>test</option> 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -